ANY TIME a dog starts peeing around the house, he needs to be restricted unless you have eyes on so he can be corrected. That is the only way to train this away. Trying to discipline after the fact does no good in curbing the behavior. As a matter of fact, a dog who is prone to resort to aggression is likely to resort to that more often if punished. He will have no idea what was wrong unless you catch him IN THE ACT. He needs to be in a crate when you are away—then immediately outside for potty break.
He can only come out of his crate when he is under direct supervision. No freedom, since he is abusing the privilege. A good idea is to teach him “place” , so while you are watching TV or eating or doing something, he must sit on his bed, so he is out of his crate, but by no means free.
Since he is marking/peeing around the house, put a belly band on him. (Available at most pet stores.) It will protect your furnishings at the same time it deters him from marking. If you see him attempt to mark/raise his leg while wearing it, you still correct. If he stops immediately, give him a nice treat and lots of praise.
It is also important to use an enzyme urine cleaner like Nature’s Miracle. He is probably going/marking in same places b/c it smells like where he or another dog has gone before, and his instinct is telling him its an OK spot. Even if it doesn’t smell like urine to you, dogs have SUPER sense of smell so the enzyme will do other trick. Treating more than once and limiting his access to these spots is best. If its a throw rug, pick it up. If its the side of a chair or sofa, treat and block with a solid object like a card board box weighted so he cannot move it.
If he is going into another room to mark, close all the doors to those rooms. Gate so he is in same room with you so you can grasp teachable moments .
The dog needs more structure and an understanding of why he needs to follow instructions—good things happen! Stay consistent with this and give him a nice treat when he complies.