If he's not kenneled, get him a kennel(nothing bigger than an 18"x30"). Do NOT put bedding in it. From now on he sleeps in a bare kennel. Many think that a bare kennel is cruel. That's total BS. My dogs willingly sleep hours away on our hardwood floors and outside on a wooden deck...even when dog beds are available. There's nothing cruel about it.
When he's not being closely supervised, kennel him. Watch for him sniffing around and if you see him sniffing, yell at him to distract him and immediately lead him outside. Do not let him back in until he pees. While he's outside, constantly tell him, "Go Potty!" until he goes and then reward him with anything he likes...food treats are best.
Do not ever allow him on any furniture or your bedding. Try all of the aforementioned, before doing anything else...like neutering.
All this, assuming he's been Vet checked for a UTI.