Sounds like either submissive or excitement urination. Training him not to get so excited can help. You can do this by practicing the returning home/come for a visit ritual over and over while not reacting to his excitment, only paying him attention when he is really calm, usually several minutes after you or the visitor arrives. Obedience training can also be a big help, especially training that uses treats as the reward, as most dogs do not pee for a cookie
Seriously, if he is focused on earning treats, his mood won't tend to encourage peeing.
I would strongly recommend place training- teach him to go to his bed and stay on. Then practice around people and mild distractions, then start practicing after you've been home a few minutes, then as you get home, then as a visitor comes, but ignores him, then as a visitor comes in and greets him. It will take a long time to get to this point, but it will help a ton with the peeing problem. Staying on the bed increases his distance from the person and they can control the attention- if he starts to get to wild, they walk away and he has to calm down again before they will go back with treats and pets. Works great!
Good Luck!