Dogs are territorial, and both males and females may mark their territory with their scent (small amounts of urine). They may start this behaviour as early as 3 months old. It is, however the male dog that usually marks his terrain.
Although some male dogs may mark their territory around females, especially if they are coming into “heat”, some other males will only mark in the presence of other males.
A male dog that recognises other exciting smells and territorial markings in their garden or in the dog park will generally reciprocate with their own marking.
There may be a medical reason why your dog is excessively marking his territory; so, take your dog to the vet for a check-up and voice your concerns with him. It is always better to eliminate a medical reason first, before trying to correct behavioural issues.
Some tips on curbing this unwanted behaviour: