
Restriction may be necessary. When I got my 6yr old lab I discovered pretty much immediately that she wasn't housetrained and I don't think ever had been. I suspect it is a very large part of why she was rehomed. It took a LONG time - almost three years - to get her housetrained. Months of letting her out in the night, letting her out many times in the day, staying with her etc, all compounded by the fact that she is monumentally thick (no, that's not an exaggeration!) so any training takes much, much longer with her than my other dogs.
What did it in the end was a combination of restriction overnight (blocking all access to my vinyl flooring as that's what she would go on) and making absolutely sure she did everything when I let her out. That was particularly important on the last loo break of the day, as overnight was the worst time for messing indoors. Habit was a big factor which is why it took so damn long - she was capable of holding it, but wouldn't, because she'd always gone indoors so it was an option, as far as she was concerned. That's where the restriction came in - remove the option and it didn't happen.
She has a 'go on' cue which means 'get on with it and go to the toilet' - this was essential as she is so, so easily distracted so I had to keep redirecting her to go.
Also, the thing that really started things going in the right direction just before I put restrictions in place was clicker training: I started to click her whenever she did either, whether we were at home or on a walk. As long as she was outside, she got clicked. It made her more aware of what she was doing and it really helped her turn the proverbial corner. Now, she is totally clean :-)