Here's a few things to try.

Get the dog to the vet - it is possible that there is a medical reason for this behaviour as it seems to have happened suddenly.

Confine the dog to an easily cleaned area at night - a hard floor rather than carpet - this will not stop the behaviour but will make life a lot easier for you and the house a lot less smelly.

Start from scratch again - pretend that you have just brought home a brand new puppy and it knows nothing. It is hard when you feel so frustrated and especially when you have someone moaning at you but try to think like you would with a tiny pup. That means ignoring, really ignoring, mistakes and concentrating on the times that the dog toilets in the right place.
Try and forget about the fact that you have done all this before and think of it as brand new for the dog too.

If the dog checks out at the vet OK then I think you need to make it feel more secure. Oddly you would think this meant fussing over it - it doesn't. Ignore the dog when you leave the house ( always give it a chance to toilet at least ten minutes before you leave), when you come home and any time it asks for attention in any way. When you come home ignore (don't look at or talk to it) until it goes and lies down (this may take a LONG time at first). When it has been settled for at least ten minutes call it over, ask for a sit and only if it does what you ask do you then praise and fuss it. If it doesn't sit, get up and walk away until it has been settled for ten minutes again.

Please look in the other posts for the feeding stratetgy - you are trying to give the dog as much security as possible and lessen it's stress. Giving it as many gentle signals that are clearly understood about it's position in the pack and that the pack has a strong and able leader (you!) will ease it's anxiety and lessen it's need to assert itself.

Any questions - please feel free to email me, use private message or post again on the site.

Hope this helps - it sounds easy but ignoring a dog is a lot harder than it sounds so good luck - let us know how you are doing.

Vet first, though.