Some say that potty training rats isn't a possibility. However, with a little patience and some knowledge, you can indeed potty train your pet rat. Rats are very smart and can be potty trained most of the time.
Clean your cage. Set aside some used bedding, but the cage needs to be cleaned really well. Use an enzyme product to clean the urine and deodorize, or you can use stuff you have around the house. (Wash it thoroughly. Then spray down with hydrogen peroxide. Let that air dry. Spray down with white vinegar and let that air dry.) Once the cage is thoroughly clean, sanitized, and deodorized, put fresh bedding in the cage.
Set up your potty. If you have multiple pet rats, you will want a good-sized potty so that more than one rat can use it at a time. The litter or bedding you use should be very different from the bedding in the cage. If you use chips for bedding, then use a paper product for litter, or vise versa. Either way, it should be very different. Top it with the dirty bedding that you set aside from cleaning.
Clean your rat cage. Clean the cage often, but leave the litter pan dirty. This will help your rats to realize that they aren't supposed to use their bedding, but they are supposed to use the potty. You must sanatize and deodorize the cage each time you clean it. The more you clean it, the easier it will be to potty train your pet rats.
After four or five months, clean the potty. After your pet rats have gotten a good handle on using the potty you can then clean it. At first, just dump it and add clean litter. Then you can dump it and wash it. After awhile you will be able to sanitize it and deodorize it as well, but you want to wait a long time to make sure that your rats have the hang of it. If it doesn't look like a good place to go and doesn't smell like a place to go, then they won't go there, so don't be too clean!
Always bring a potty. If you travel with your pet rats or you get them out and let them play, then you should bring your potty trained rat a potty or they will be concerned. This is especially true if they are out and about for a long time. Put the potty somewhere easily accessible.
Rats are smart and most of them will get the hang of this in three or four months. However, you have to be patient for them; unlike other animals, pet rats don't tend to go to the bathroom in a single corner of their cage. Some will use their nest just as much as a different corner. I even had one rat who would move hers from one floor to another because she had decided she was sleeping in the place she used to go. You have to be patient and you can teach pet rats to use a litter box. Just be forgiving and know that it will take time.