> after going to the vets and drinking quite copious amounts of water
Is the vet trip relevant? Some treatments may affect input and output... Our pup was on steroids for a while and that dramatically affected his bladder control, so much so that sometimes he just 'leaked' whilst sleeping. His brain wasn't getting his 'bladder full' messages, poor boy.
> he peed in the hall and then about 10 minutes later
If you get accidents inside your dog is unlikely to have emptied himself completely so always take him straight outside and wait til he goes again. Then catch him doing it in the right place with lots of praise and a reward. I always keep a box of tiny treats near the door for all the outside training. At 5 months old I'd still be going outside with him every time so that you can reward in this way. My dogs are 5 years and 12 months old and I still go out with them if I need to be sure they've gone, esp before bed, before car trips, and often before a walk too so that I can avoid carrying two very full poo bags home!
Don't tell your dog off, although it's hard not to say anything - mine was usually Oi! Outside! whilst moving quickly to the back door to call him out. If young dogs pee inside try and treat it like it's your fault for not catching the signs, or remembering to take him out often enough and learn for next time. I would also clear up whilst he was out of sight as it's quite hard not to tut and moan whilst doing it!! He isn't misbehaving, his bladder capacity
is gradually increasing but accidents at this age aren't unusual.