You don't specify what "accidents" and whether or not your dog is neutered.
If he isn't neutered; you should take him in ASAP as he's learning to mark his territory in the house. the longer he does this, the harder the habit will be to break.
Yes you need to thoroughly clean his bathroom spots but you also need to really look at what he's doing and when so your training can adjust to alleviate the problem.
If he's pooping in the same spots; odds are that he isn't getting enough exercise and is NOT being walked far enough after his regular feeding times. Letting him into the yard is NOT good enough for most dogs but when they have regular feeding and walking schedules; they function like clockwork.
Does the dog pee or poop only after you leave the house? If so, it could be separation anxiety (and the nervousness from knowing you've left him alone)or that you leave him alone too long without having access to do his business outside.
Does the dog pee or poop in the morning before you get up? If so; you MUST get up earlier and take him on a long walk everyday instead of sleeping in.
You should be walking him for at least two very brisk half hour walks every day along with some running or jogging.
In other words; you need to focus on why he's doing what he's doing so you can develop a plan to train him with positive feedback to do the right thing instead of trying to figure out one type of scolding that you hope will work for anything.
This has happened to us before. I diluted vinegar with water and poured it on the spot. I then used my carpet cleaning machine, filled with hot water and solution, to clean the carpet again. The dog never used that spot again & it got rid of the terrible smell.
I suspect the first time may have been an accident but other times were more or less planned because dogs tend to go back to places previously used. I have good experience with a product called Nature's Miracle. It's an enzyme eater and will remove urine smell and stain. It's also recommended that you cover the spot for awhile until the dog forgets. You need to cover it with something that allows some air to circulate. It may look funny to have a large plant stand or chair or garbage can upside down in the middle of the living room but you won't need to do it for long...just until the dog forgets and can't smell the urine.
Go to your local pet supply and by "Nature's Miracle." it works really well and takes the odor out so your petcan't smell it and be interested in usung the same spot.
Don't use a cleaning product with ammonia in it to clean the soiled area...ammonia is in dog's urine and that's how they "mark" their territory.
Try using "PetZyme" to clean the area...we got it at our local pet store. It removes the stain and the smell without leaving an ammonia scent behind.
Add your voice to the conversation. Click here to answer this question.