Dogs are dogs and most use their urine as a messaging system. Peeing on things is their way of sending a "Rover was here" message to the world. Marking is a predominantly male behaviour, however it is not limited to males.
Some female dogs are just as bad when it comes to marking, but it is typically intact females who are in season.
The true culprits are the boys. Most males, especially intact ones, always have a store of urine in their bladders so the option to mark is always there. Sometimes they do it to mark territory, other times, it's during periods of socialization, stimulation or arousal. We often get people asking us how to stop their male dogs from marking everywhere. Usually around the time they start to hit adolescence and sexual maturity (6 - 12 months on average), dogs will start marking behaviours.
I prefer male dogs and tend to keep them intact, so I've dealt with a lot of marking behaviour. For several years there were 3 dogs in my house, 2 were intact. In the end, controlling this marking behaivour is just like any other trained behaviour. Set your ideal expectation and train to meet it!
I never allow my dogs to mark on people's private property, hedges or fences. I find it unnecessary and rude. When we're on walks through the subburbs, they are on leash and I don't allow them to stop and pee at all. All of my dogs know how to pee on the command "hurry up," so before we set out, I insist that they "hurry up" in the yard. Once we are on the move on leash, they aren't allowed to stop unless I stop. My expectation is that when I stop, they sit. This is important to me when walking multiple dogs, especially. Imagine if 3 dogs were going about their 3 separate agendas throughout our entire walk? We wouldn't get anywhere very quickly! When we get to the park or an open field, I'll allow them a washroom break with my "hurry up" command.
Teach Your Dog a "Leave-It" Command
When they are off-leash, I practice obedience games with my dogs all of the time. We interact and play and I carry a variety of rewards. Sometimes food and a toy and other times, it's just my voice and play. Obedience is so important if you allow your dog off leash. Having good response to voice commands is crucial if you expect your dog to make progress and repond to your commands. Making listening skills into games makes it fun and you'll stay in the habit of practicing with them. Practice skills like "leave it" and response to name so that you can use it to call the dog off of marking on something inappropriate.
Stopping a Dog from Marking Outdoors
Make sure your dog understands how to be redirected with your voice or you'll need to keep them on leash to physically stop them. Watch them closely! This can't be expressed enough. 100% supervision is key! Your timing is the other crucial detail. Marking is a self-rewarding behaviour, meaning once they've started, it's too late. You need to watch for the first signs of marking. That means the sniffing stage is when you'll have to interrupt them. Dogs will typically sniff, then align themselves parallel to what they're aiming for and then they'll lift their leg. Your goal should be to stop them at the sniffing or at the latest, the aligning stage. Again, if they have the opportunity to pee, it's like giving them a cookie for the very behaviour you're trying to stop. It's crucial that you prevent them from getting that reward. The reward should come from you if you are able to successfully redirect them. You can use a command like, "leave-it" or "don't pee on that!" You could also interrupt them by simply calling their name. General obedience skills are a must if you're trying to keep your off-leash dog from marking. If their obedience skills aren't where they need to be for a verbal response yet, you must keep them on-leash.
Allowing Dogs to Mark
I do like to allow my dogs the opportunity to mark in appropriate situations. This, however, is up to you! When I get my dog to a place where it's appropriate for them to be off-leash, I will release them with "ok" and allow them freedom. When I know it's a location they are free to pee in, I will allow them to do so. I use these situations for practice though, often calling them off of things and reinforcing good responses with variable rewards (food, play, toys or praise and petting).
Preventing a Dog from Marking in the House
We're all a bit different in what we are willing to allow. Obviously, nobody wants their dog marking in the house. Stopping this from happening is all about consistency. Supervision of a young dog is a must around the time they start wanting to mark. When you can't supervise them, a crate is your best solution to prevent accidents when you can't catch them. If you do miss an accident, be sure to clean the area thoroughly with an odour eliminator to destroy the temptation, especially if you have multiple dogs in the house.
Teach Your Dog To Pee On Command
Another great thing to do to keep marking under control is to teach your dog to pee on command. Join 20 time World Agility Champion, Kayl McCann in this great video that will teach you how to accomplish this goal.