First, let's get rid of the myth that only male dogs do this. Females are not above lifting their legs and pointing to a nearby chair leg when peeing. It is not just a male things.
Your dog may be marking its territory and markng means just that. They are choosing a spot , peeing and then proudly announcing, with the urine, "I've been here! This is my spot!" If another dog potties there, or if the dog feels the scent isn't strong enough, he will go back to the same spot to pee again, just to make sure the message is clear.
Although any dog may mark, the marking behavior happens most often with dogs who are males and not neutered. A dog who has not done this in the past may feel he now has a reason to mark such as a new person or pet in the home, visitors, or a sibling dog in your home may be challenging him.
Okay, what now? Well, we need to work on the problem.
First clean any spots that exist right now with an ammonia free cleaner to remove your dog's mark. I use vinegar mixed with water as it erases the smell completely.
That's the easy part. Now the more difficult part. Watch you dog very carefully now. If you can't watch him with an eagle's eye, crate him or confine to an area where marking is not prohibitted. It's hard to watch a dog constantly but be SURE you are if the dog is loose in your home. Sometimes it helps to put the dog on a leash and just keep him beside you. If you catch the dog trying to mark, tell him NO! and take him outside. Give him tons of praise if he lifts his leg outside.
Your dog may also be competing to be the boss, even with you! He will need to learn that the territory is not his and therefore does not need his "mark". You can teach him this by working on basic commands or even tricks where you are the leader. Teaching sit, down, come, stay teaches your dog that you are the leader. Once he realizes that there is no need for him to be the boss, the marking should decrease.