White vinegar is not only an effective carpet cleaner and urine odor remover, but it also acts as a repellant.
Prepare a solution of white vinegar and water in a 1-to-1 concentration and spray it over your carpets and the areas where your dog likes to urinate.