Many European countries see crates as unnecessary, so don't feel this is the only way your dog will learn.
Firstly, dogs don't generalize well at all - this means you might teach "roll over" at home, but when you go to the park the dog is clueless to the previously-taught command. This also applies to potty-training, the dog has not been trained during the night, or when you're in your bed and they're left to themselves. The fix is re-enforcing the behaviour you're looking for and setting-up for success. If you treat once a week for your dog not going in the house at night, but they also continue to go in the house the other six days a week, you cannot expect more progress - you are sending mixed messages to your dog. They need continual success. This might mean staying up later on a Saturday night and getting up early Sunday morning, so they have their last potty break later and you keep them outside the rest of the week (should it be safe). Then slowly increase the time they're waiting overnight.
You cannot "punish" your dog for a past event either, as they will not associate the previous act with your scolding. You'll just produce an insecure and nervous dog. Any mistake they make - steam clean the area and spray with distilled vinegar or a special enzyme spray which prevents the dog from marking the same area again. You might also wish to take a step back in training, but better manage the issue, by praising your dog (toys/treats) for going in an easy-to-clean area of the house, such as on tiles or lino. Our 14 month old pup sometimes gets issues with bile and when she's about to throw up, she runs to the lino kitchen and we ignore her. As soon as she's done, we give her lots of praise (not enough time for her to make it outside). Initially, we called her over into the kitchen.
If you can, install a dog door so the dog can take themselves out on the few occasions they feel like they can't 'hold it'. Personally, I prefer a doorbell on the back door. You teach the dog to push the button on command and then say the command every time they indicate they want to go out. Eventually, they start ringing the bell without the command and you can swiftly get the door for them. I have tried doggie bells, but they are much too quiet. The bell I use has a larger button, so nice and easy to press and the bell button itself doesn't need batteries or need to be connected to any power supply - it's kinetic : similar to this https://www.amazon.co.uk/Waterproof-Self-Powered-Eco-Friendly-Transmitter-Indicator/dp/B06Y48BSMP/ref=sr_1_9?ie=UTF8&qid=1531769615&sr=8-9&keywords=door+bell+wireless+kinetic
Good luck and if you continue to struggle, hire a behavourist to help you out and as potty training really isn't something that people shouldn't really be struggling with after so many months, they'll probably require you to get a vet-check up too, to ensure it's not medically related.