In January my fiancée and I adopted a 1 year old beagle who was rescued from a lab. We have been attempting to potty train him since then, to limited success. We used the "umbilical cord method", keeping him attached to us on a leash at all times for the first 10 days, slowly giving him more freedom after that, and resetting back to the 10 days whenever he has an accident. We also started out taking him every our, before slowly expanding it so we now take him out every 4 hours.
After the ~3.5 months we've had him at our apartment it seems that he knows he is supposed to pee outside. He gets up and starts moving around just before the times we take him out, and he's become very consistent at peeing when we take him out. The issue is that while he knows to pee when taken outside, he doesn't seem to want to/be able to hold it in if things don't go exactly according to plan.
An example of this is this morning I got up with him to feed him, and usually during this time he doesn't have a leash on, and then I put it on once he's done eating. For some reason today immediately after eating he grabbed a toy and started running around with it, and wouldn't let me grab him to put his leash on. After doing this he immediately stopped and tried to pee, so now we're back to 10 days stuck on the leash 100% of the time.
He doesn't seem to have a certain place he pees in the house, it's just wherever he happens to be. Does anyone have any suggestions on how to get an adult dog to better understand the concept of holding it and that he really can't pee inside?
Additional information: He only has accidents when off leash. Since we keep him on leash for ~10 days every time he has an accident there's at least 10 days between each accident, and the longest he has gone is 20 days. We do train commands like no/come/down pretty regularly.