It is important to identify clearly what triggers marking and to reduce exposition to such stimuli as much as possible. Limit access to the spots where marking occurred initially. If there are tensions in the household, improving the situation will be key to prevent marking.
It is also helpful to manage stress and anxiety. In other words, your cat should be able to go on with his feline daily activities such as climb, scratch, rest and hunt for his meals (e.g., food dispensing toys). Also, your cat should be able to go to a safe space when he doesn’t feel like having interactions. This means having access to high-hiding place.
Finally, it is not recommended to punish the cat (scream, slap, spray water, etc.) because it will enhance the anxiety.
Even with a good management of the surroundings, some cats will keep on marking the house. Visit your veterinary to find out if medications can help with the issue.