OK, so he's only 4 months old, but he doesn't seem to have "got" this toilet training at all, although in all other respects he's a model dog.
We have done everything the books and learned people on here and at puppy class say. We've taken him out very regularly, praised him like mad, ignored all the accidents indoors etc... He knows it pleases us if he goes outside, as he comes bouncing up for praise afterwards, and he just about wees on command, IF he happens to want to go. But he will just as likely pee on the carpet if he feels like it. He can last for hours without going at all, too, so it's not as if he just can't hold it.
How am I going to drum it into him that inside is bad?
Just keep on as you are. The accidents gradually get less, and IME they are pretty reliable by six months. I think it's like children- just a question of them having the maturity to be fully capable, and four months is still quite little.
he is still v young so not unusual for that age to be still having accidents, one of my dogs was just like that, and we were told not to tell him off as it is likely to stress him, but to just clean it up ignore the negative behaviour and praise the good.
So when he does it outside make a big fuss of him and give him a small treat, but withhold that if he does it inside.
What everyone said... hold on in there. I rescued my OldLady nearly a year ago and soon realised she wasn't house trained. It came to a "worst moment" head when I went upstairs, realised she had peed on my duvet and as I stepped back to remove the covers etc I stood in a poo.
I just stuck in there, seemingly endlessly, with the rewards for going outside and the silent cleaning up with the inside.
In fact, as I was typing that, I just spotted one of her newly developed signals to go for a wee...let her out and she did <yay!>
Stick in there, Clam. 4 months is still young. Consistency is the key
Mine was still having the odd accident at 6 months (and even, very rarely, has had them since if he hasn't been able to hold it in overnight for example, or if for some reason he didn't 'go' during his last outing).
It takes them time to get the hang of it, and 4 months is young. He'll get there.
I've always found that praise for good performance - as effusive as possible - coupled with disgruntled moaning when clearing up any messes gets through to them in the end - sem to recall my first dog, a collie cross, was 8 or 9 months old before reliably dry at night.