Puppies and senior pets are known for having the occasional accident, but it can happen to any dog. That’s why it’s important for all owners to know how to stop a dog from peeing on carpet. Read the full guide here: https://topdogtips.com/how-to-stop-a-dog-from-peeing-on-carpet/
If your dog is already house trained but continues to pee on your carpet, it’s probably because the smell of urine is still there. Even if you can’t smell anything, your dog probably can. A dog’s sense of smell is 10,000-100,000 times greater than ours!
"Making natural pet repellent is an option, too. Most dogs don’t like the smell of citrus, including lemons, limes and grapefruit. You can make a homemade dog repellent by adding 2-3 tablespoons of citrus juice to a spray bottle filled with water. You could also use 15-20 drops of citrus essential oil in place of the fresh citrus juice."