Wow. Not sure where to start.
Please don't take this personally, but you are making a lot of mistakes. Reading your post, I'm not sure how you managed to housetrain dogs prior. I'd say you got very lucky and they learned despite your handling and not due to it.
I'm just being up front and I'm sure this is not what you want to hear, but you asked for advice.
Puppies need access to water more than once a day. In fact they should not be denied water at all. This is not just inappropriate, but it fits the criteria here for a cruelty charge - and it takes a lot for a cruelty charge. A dog must have access to water.
Puppies cannot go 8 hours (a minimum he's being expected to hold it based on 3x out per day) without being let out. An unhousetrained puppy 12 weeks old should be taken out hourly. Yes, I'm serious. I'm actually almost speechless at the idea of a pup 12 weeks old being taken out 3x a day. The rule of thumb for a pup being left alone is about an hour per month of age, in large part due to bladder/bowel needs - so even a HOUSETRAINED pup should be taken out every 3 hours MINIMUM.
Again, not personal - but these are the objective facts - you've set him up to fail, by not taking him out anywhere near enough for him to figure out what this whole housetraining thing is. He has no choice but to void in the house because he's not being taken out enough. The worst part is when he does, you are punishing him for going. This is a 12-week-old puppy. He has NO IDEA that you are upset that he went in the house. He had no choice. You are messing up this poor guy's head big time, because if he even has any clue that your punishments have anything to do with his peeing/pooping (which is very likely he's NOT), he is going to think that going to the bathroom is what pisses you off. Know what happens to these dogs? I get calls from the owners when the dog is 7,8 months old and the owners have had it. The dog "cannot be housetrained", they swear. It's not them, it's a dog that just won't get it. The dog constantly sneaks off and pees/poos in the house. Why? Because all the dog knows is they get punished for pooping and peeing. They have not been shown properly what you want from them - do your business outside - so they have no idea why they're being punished. All they know is poop/pee means they get punished (and yes, it does hurt their psyche - these dogs are almost always riddled with confidence problems, insecurity, anxiety, and sometimes straight up fear of people). These dogs are hard to train as a result of the psychological effect of being punished during the sensitive stage for peeing and pooping. It's terrible for them. They have to pee/poop. They have no choice.
I've told you how to housetrain, above. The number one cause of euthanasia for dogs under 18 months of age is behavioural problems. This is exactly how it happens. I hope you are open to advice, because this is so unfair to this puppy. And please, stop denying him access to water. I don't know why you are pulling it, but if it's because of his housetraining, this is NOT the way to do it. He is probably spending a good chunk of his day in distress from thirst, if not dehydrated.
I'm willing to advise, if you want it.