In case you see your dog doing this, before you start panicking (because you don't know if it's health issue or not) you should read this.
Some dogs start urinating as soon as they hear door bells. It is not a comfortable situation, especially if you have someone coming for the first time, but there are few steps you can make, in order to prevent it or remove it.
Some dogs are peeing because they are too excited, once they see someone coming, and if it's someone they like, they will be even more excited.
When you have puppies, they can also do that, but not only because of their excitement, but because they cannot control it very well, because the muscles of their urethra is still not developed enough. Don't worry; it will get better and stronger in time.
But if this continues when they are older, you should consider calling you vet, so that he can help you.
You should think well, and make a list of the situations where he was urinating, and then you will probably find out if he has some health issues, or he simply doesn't want to get rid of that habit.
Dogs can urinate, when they want to show you that they have ultimate respect for you, and their obedience. Especially female dogs will do it, but if they are urinating because they are happy to see you, well it means that they are not obedient.
To solve this, take your dog for a walk before you have some guests, and until he stops doing that, tell your friends not to pay too much attention to him, that way he will get used to be calmer when they come.