What does it mean when a dog pees a lot?

If they're very happy or very angry, they can pee, but most of the time, dog pees when other dogs are around. The peeing dog does this to 'claim' his territory.