I f your dog eliminates when he gets attention, seeing his owner or guests he likes it could be excitement urination. Excitement urination occurs most often during greetings or playtime. The thing that distinguishes it from submissive urination is that it is not accompanied by submissive posturing.
Make sure you play with him outdoors until the problem is resolved. Try to have your dog outside when he greets you and do not greet him until he has eliminated. Keep all greetings low key.