Cases of this type are often the mistake of owners who are too lazy to house-train or who have left the dog solo for long periods of time.
Confinement in a shut crate night and day is useful. If you know the dog won’t urinate or defecate while you’re at home, you could let him out of his crate but keep him under close observation at all times. Or the dog could be leashed to a kitchen table leg or any solid support and taken out when relief is called for. Since the dog does not likes to soil his own quarters, he would be more likely to hold himself when crated or tied up short than when left to roam the house freely. Take him out faithfully at steady intervals: the very first thing in the morning, and the last thing at night, and many times during the day. When he does what is asked of him outside, praise him richly. You may extend a reward of some enjoyed tidbit. As for mistakes, clean them good using soap and water and a commercial odor neutralizes. Scold but don’t spank.
Allow one person to do the training, when possible, should be the one who feeds him. Let that person available all day and every day as needed. And let the teacher give the dog a great deal of affection. A lot of these hard-to-housebreak dogs had no one to love and no one to please. Every dog would like to please his master; and if given a master, he would want to please him as soon as he realizes how.
If housebreaking is delayed beyond a year of age, the dog could be very stubborn; on the other hand, he might catch on really quick. Either way, housebreaking could be done, and is well worth doing. Many a supposed “dirty dog” has been sold for a bargain price simply because it was claimed he couldn’t be trusted in the house. Training an older dog takes time, since bad habits should be broken as new ones are acquired.
The dog sold as “guaranteed housebroken” might be a problem for a while. Unknown voices, a new bed, and an unfamiliar house and yard can result in a quite homesick animal. Give this dog time to get familiarized. A dog seldom forgets his house manners but he is clearly confused while moved to a new home. Don’t hasten the training; your first job is to earn the dog’s confidence.