Is your dog jumping up and excited, or rolling over and urinating? The difference is important in identifying the reasons for the behaviour.
If your dog is rolling on to his back and urinating this may be rooted in anxiety.
Either way, how you approach this issue is essentially the same; you don't want to cause fear or anxiety by shouting at your dog as this could increase the problem.
Excited young dogs can have difficulty holding on, especially if they have been alone for a period of time and have a full bladder.
A visit to the vet's just to make sure there isn't a problem would be useful, and then you need a plan to help your dog keep calmer at certain points when he is most likely to have an accident.
If the problem is when you arrive home, a simple solution is to enter the house through the back door and let your dog out into the garden straight away so any urine is released in a more appropriate place.
A simple sit and wait training exercise using treats to reward his success will help build up self-control. Start by working in areas and at times of low excitement and build up to situations that would normally cause him to wee. Practice and patience are key.