To help the dog's peeing issue, we need to face the fact it's an owner problem and not the dog.
Get rid of the dog, fine. But the next dog is likely to have the same issues.
And yes, if you want a pristine home, and a carpet with no vomit, urine or poo stains, you might not want to get a dog. Or have a kid.
Should you want those things, you can either get a real nice carpet cleaner or tear the carpet out, like we did, ages ago
ETA - it's a dog problem, nearly universal to dogs (puppies actually)...but it becomes an owner problem if not dealt with correctly...when people say things like "If this problem doesn't go away the dog goes" it's usually of the belief the dog is defective/wrong/a problem, when, in reality, the owner has likely caused it, inadvertently, probably, but still.