Peeing indoors is either a medical problem or a behaviour problem, and the first step is always to rule out a medical cause. A dog that was reliably house-trained for months or years doesn't usually "forget" without a reason.
Watch closely and note: How much urine? Is your dog squatting and straining, dribbling, or lifting a leg on vertical surfaces? Does it happen while sleeping? Is your dog drinking more? Does it only happen when you're out, when visitors arrive, or when your dog is excited? These details point your vet towards the cause.
Straining with little or no urine coming out is urgent, as it can mean a blockage.
