If the dog is completely housebroken and the only time it goes in the house is when you leave, then it sounds like separation anxiety. There are a couple of ways to deal with it and you'll have to figure out what works best for your dog. There are training methods to make your dog feel more in control, chew toys to keep them busy (ones with treats inside that they have to work at to get out are best), exercising them to tire them out, and types of 'aromatherapy' (for lack of better words) to help ease their anxiety. There is also crate training, although I don't know how easy that is for an adult dog.Search the web for 'separation anxiety in dogs' - it is a lot more common than you might think. Good luck.