Some housetraining issues are related to leadership. A dog that is housetrained, may start going in the house to make a statement.
You should try to first clean the spot up very well with an enzyme cleaner. This will get the smell to go away for the dog. Normal cleaners only work to make humans not be able to smell anything, but dogs have much stronger noses. Simple Solution and Nature’s Miracle are both names of good enzyme cleaners that big pet stores will carry.
Then you can try scattering dried dog food on the area where you dog had accidents. Dogs do not like to go where they eat. Also keep your dog on a leash at all times in the house so that you can supervise the dog. Once he stops going in the house, you can slowly give him more and more freedom off of the leash.
Most importantly, though, is getting strong leadership with your dogs. Dogs are pack animals. We are not. Dogs MUST have a pack leader. We often expect our dogs to act and understand life in the way that we see and understand life. However, without good leadership, a dog is very uncomfortable. We often get a dog so that we can love and nuture it to death. We are getting what we need out of the relationship, but the dog is not getting what it needs most in life – leadership! Once a dog has leadership, it can relax and accept and appreciate all of your nuturing and loving. Without leadership, you have an unbalanced relationship, with you getting what you need, but forgetting what your dog needs.
Give your dog good leadership by teaching it commands. It should sit and stay before feeding and before going outside and whenever you can fit it it. You should go through doorways first and your dog should not walk ahead of you on walks, but beside of you. You may not care, but your dog does. Letting your dog walk first through doorways, or ahead of you on walks, tells your dog that it is the leader. That is how a dog understands the world.
Give your dog leadership, and you will have a happier dog! (And a cleaner house!)