The old adage "You can't teach an old dog new tricks," might discourage you from trying to teach your older dog to stay off the carpet, but it is possible to teach him something new. The difficulty will be to change his habits. Older dogs already have an idea of how the world works and it's harder to make a change to their routine than young dogs who don't have long-established patterns.
If you're moving into a new home or if you are bringing home a new dog, set the boundaries from the beginning. From the moment he steps into your home, let him know where he can and cannot be. You might need to block off rooms with baby gates for a while. Make sure he knows where he can go. Give him a space to call his own and feel comfortable in.
There are several methods to use based on your dog's temperament and the way he reacts to his new rules. Read through the three below and decide which will be best for your dog, or mix and match steps to come up with the best training plan for your dog.