Sometimes dogs, but more often puppies cannot control their bladders when they get excited. Your dog probably doesn’t realise that they are weeing so you shouldn’t try to correct this behaviour.
A wire coated Terrier dog with an incredible red coat
Puppies will usually grow out of this. If your older dog urinates when excited, try to avoid over exciting him.