I just helped my Mom with this while visiting her in AZ. I learned it when my female cat was very sick and peed in my bedroom, over and over. The smell went away COMPLETELY. Trust me, cat pee is REALLY gross!
First, go to Walmart and buy a big box of baking soda (or several, depending on how much area you need to cover). You can find really big boxes in the laundry section.
Next, sprinkle the carpet liberally with the baking soda. Use a broom or scrub brush to work it into the fibers and let sit for at least 1 hour.
Vacuum the carpet very well to get the baking soda out.
Make sure you test in a closet or something. I used this on dark brown carpet and it didn't effect the color, but just be sure! Using a solution of 3/4 cup regular bleach (not concentrated) to 1 gallon warm water, scrub your carpet, concentrating on the areas where the dog has urinated. If you have a carpet cleaner, add the bleach to the water in the resevoir tank. For best results, I would suck this water out of the carpet, but if you can't, just use a bunch of old towels or some old blankets to soak up as much water as possible.
Let carpet dry and again sprinkle with baking soda to help absorb bleach smell. Vacuum well. You could also add some carpet cleaner to the bleach water to help, but it smells so much better anyway, that it didn't bother me.
The smell should be gone and once the chlorine smell disappears, your carpet will be fresh and clean.
Hope this works! In the future, if your dog pees on the carpet, immediately soak up excess and dump baking soda on the spot. Let dry and vacuum up.