I think the dogs have this one down pat: They know when it’s last potty break for the night when I say the words: “Let’s go peepee guys!” (Yes, that’s what I say. Shut up.) They know this is when they get a yummy little treat before bed, so they run outside. They also know that as soon as they go back into the house, they get those tasty morsels.
These days, they completely side-step the going to the bathroom part–they just run outside, then wait by the door to come back inside. Example: