Your dog was clean for 3 months. Now there is a puddle by the back door twice a week, and you are back to mopping at 6am.
The veterinary check comes first
Do this before you change anything about training. Urinary tract infections, other urinary conditions and pain are ordinary explanations for a house-trained dog starting again, and they are not trainable.
Sudden behaviour change warrants a veterinary examination, and pain often presents as a change in behaviour rather than as obvious lameness. Take a note of when the accidents happen and how much.
Safety note
Book sooner rather than later if your dog is drinking more, straining, or going in small amounts often. The same applies to leaking while asleep, pain, or being unwell in any other way. That combination is a veterinary matter, not a training matter.
If your veterinarian finds nothing medical
Then treat this as house training that never fully generalised, rather than as something lost. Adolescent dogs also sleep less predictably, drink more after harder exercise, and hold on less well when excited.
Two ordinary patterns explain most of the rest. The dog was let out into the yard alone and did not actually go. Or the household stopped watching, because a clean dog earns freedom quickly.
Today, for the next 10 days
Go outside with your dog every time, including at 6am in the rain. Stand still, say nothing, and wait up to 5 minutes.
The moment they finish, feed 3 treats outside, on the spot. Coming back in should not be the only thing that gets marked.
Take them out on a schedule rather than on request: first thing, after every meal, after every nap, after every arrival, and last thing.
Cleaning and supervision
Clean accidents with an enzymatic cleaner made for pet urine. Household cleaners can leave a scent that marks the spot as a toilet.
Close the doors to the rooms where it happens for now. A dog cannot practise a mistake in a room they are not in.
Write the times down for 10 days. A pattern on paper is what turns this from a mystery into a schedule.
What not to do
Do not scold, do not point at the puddle, and do not put your dog outside as a consequence. Punishment-based approaches are associated with fear, avoidance and defensive aggression.
The practical cost is worse than that. A dog who has been told off for going indoors often learns to go behind the sofa, instead of learning to wait.
Behaviour change is built from management plus reinforcement. Here the management is doors and a schedule, and the reinforcement is 3 treats outdoors.
Today's version, in one line: book the veterinary check, and go outside with your dog every time for 10 days.