When an adult dog is not housetrained, and things like a bladder infection have been ruled out, I treat them the same as a new puppy. This means preventing indoor accidents as much as possible: no being loose indoors, by using indoor baby gates, or an Xpen, or a crate, or keeping him on a leash indoors.
I forgot to ask: is he neutered? It may be hard to house train if he is not neutered.
Do the positive things, by praising him when he goes outside, but you must not set him up to fail by letting him loose in the house. If he has eliminated outside, then he can have 10 or 15 minutes indoors. Set a kitchen timer to be sure it is not longer. After the 10 to 15 minutes, either take him back outside, or confine him on a leash or in an Xpen or crate.
Gradually you can increase 15 minutes to 20, to 30, to an hour. Just be patient, never punish him for indoor accidents, and praise him for eliminating outside.
Let me know what other questions you have. Rebecca