A classic approach says: ignore the dog COMPLETELY when leaving and entering. NO eye contact, NO petting, and NO talking. This is also helpful to prevent puppies from peeing at the door when they grow up. If your puppy started peeing out of excitement when they see you and you were the culprit - you made your own bed.
Other than ignoring your dog, some tips involve managing the problem such as making sure they have gone to the bathroom recently and to only say hello to your dog on an easy to clean surface. Diapers or Belly Bands can contain messes. But they don't fix them.
Sometimes the dog grows out of it at a year old, if you stop getting them too worked up by the door. If it doesn't go away, try this:
Keep some treats by the door and feed you dog treats for sitting nicely at the door. If your dog doesn't pee, then you can move to the next step - lean over your dog a little bit (introduce the idea that they can be submissive very slowly).
Eventually, you should be able to pet your dog, if only a little. If they pee - go back a few steps and move slower towards the goal.
Another tip: sometimes the dog still gets excited by sitting. If so, try teaching your dog to do a down instead. You can also try keeping your dog crated when you arrive and only letting them out after a few minutes after your arrival. Good luck!