I hope this helps!
Usually it is because of feelings of insecurity or a perceived
threat. This perceived threat, for example, can be an introduction
of a new baby, a new pet, a visitor or even a new piece of furniture.
The smell of other animals on your footwear or clothing can also trigger
a dog to feel the need to mark his territory.
For example, a new baby in the home brings new sounds, smells,
and people, as well as changes in routine. Your dog may not be
getting as much attention as previously. Changes cause him to
feel anxious, which may cause him to mark.
Some dogs feel the need to lift their leg and pee on all new things
that enter your house, shopping bags, visitors belongings, new
furniture, children's toys etc. Many of these dogs are lacking in
confidence and by marking new objects it makes them feel more
secure having deposited their own scent on these objects.
Some dogs will never mark in their own house but will embarrass you
by marking if you visit a friend or relative's home. Your dog feels less
secure there and feels the need to make it more comfortable to him
by laying down a few of his own familiar scents.
Even a previously house trained neutered male dog will urine mark
under certain circumstances. This doesn’t mean it will become a
regular problem. He may urine mark one or twice in a new home and
then never do it again.