All our elderly dogs... it was a part of getting old. Or so I thought. ??
Two examples, off the top of my head:
One just couldn't make it outside fast enough. I would GUESS the having to go feeling hit faster, then she could get to the door. She had hip issues.
Another one... we would let him out, and he would come back in and go potty. I'm fairly sure he wasn't all "there" in his later years.
BUT potty pads and such weren't around, at the time (that I know of)... so, I have no idea if something like that would work. I think there are doggie diapers. ??
Maybe (hopefully) DeeDee has some better experiences she could share.
I think I would try the midnight potty session first... on potty pads. Except, being a male dog... he probably lifts his leg. Not sure how that would work on a potty pad, or something similar.