If your male cat has not been neuted, it can be very very difficult to get rid of the smell. Male urine is very strong and ridding the household can be a nightmare. Even getting rid of female urine smell can be difficult.
The best thing to do first is to clean the carpet throughly with an enzmatic cleaner that you can get when you rent the carpet cleaner. If you own your own carpet cleaner, go to the store and purchase a product that is designed for pet urine.
Once the carpet is cleaned throroughly, I suggest the use of a product called ZeroOdor. (www.zeroodorstore.com). It can only be purchased online or via phone. This stuff is amazing and will remove any pet odor from your carpeting. You may have to use it 2 or 3 times total, but the odor will be gone and the carpet will be left smelling odorless and fresh. Wait until your carpet cleaning has dried to use the Zero Odor and follow directions closely. I can tell you from experience that it works very very well and you will be happy with the result. Neutering your boy - if he already is not - will help keep him from doing this in the future. I would also have him checked by the vet if this behavior is new to make certain he does not have a urinary tract infection.
Please let me know if I can help further.
Feline Healthcare
16 yrs health care mgmt & issues relating to cats, reproductive issues and multicat environments