Sorry, just saw it is a pug.
What breed is he? Training tajes time, patience and consistency and vigilance. Some males just love to "mark" things. Make sure you clean the area he marks thoroughly with an enzyme cleaner or some vinegar and water.
Is he crate trained? Does he have the run of the house when you are or are not there? Is he taken out frequently? You might want to try confining his available areas, especially if you are not around. If you catch him marking, give a firm and loud reprimand like 'NO!" And take him out whether he has gone or not. Do you have an outside area he uses? Do not hit him. When he does go outside, praise him.
You just have to be a step ahead of him.
If you have major issues, he us not crated while you are gone, make or invest in a belly band. Do a Google search to see what these are.
To be honest, I have had many male dogs but had a Yorkie I could never keep off one spot in the house no matter what I did. Wish they had belly bands then! Our Greyhound marked a coffee table on occasion and the Christmas tree. Well, I could understand that but he was not ginpven access to that room if we were not home. He was either crated or I gated off the room.