Check with your vet first
Mention it at your next vet visit, so your vet can rule out a urine infection or another health problem, especially if your dog also wees often at other times.
Keep greetings low key
When you come home, wait a minute or two before saying hello, and greet them calmly. Crouch down side on rather than leaning over them, speak softly, and stroke their chest rather than the top of their head. Ask visitors to do the same.
Greet outside
Let your puppy toilet just before visitors arrive, and say hello outside or on an easy-to-clean floor for now. Tossing a few treats on the floor as a greeting gives them something else to focus on.
Never tell them off
Scolding or a big reaction can make your dog more worried, which often makes it worse. Calmly clean up with an enzyme cleaner and carry on. The Hello with four paws down lesson helps build calmer greetings.