Is your dog house trained?Yes Puppies soil in the house when we first get them, but with in a few weeks we hope to have taught it where that happens; in the garden.
Now with older dogs this is probably anxiety problem (unless it has a bladder infection or they are old). Some dogs hate going out side, even having gone for a long walk will wait until the get home and inside until the go. If you have to have you wits about you while you’re out and about, ready to spring in to action at any moment, you won’t be able to you if you take the luxury of relieving your self. You are immobilised and there fore venerable.
Also if you’re tense then you can’t relax enough to perform anyway!
Some dogs piddle when visitors arrive, this is a sign of nervousness. If only your visitors would leave the dog alone and not invade its space then it wouldn’t happen. Some dogs do this with their owners, if the owners go into the dogs space rather than call the dog to them.
It is also a natural thing for dogs to mark their territory, in our world it is unacceptable to do this, we build fences and walls instead. We have to show the dog in a kind but effective way that we don't need help in this area, and relieve them of this behaviour they feel duty bound to perform.
As with any behaviour there can be a whole host of reasons why they do certain behaviours, we have to find out why and put an effect plan into action to cure it kindly, with undestanding and patience.