I'd like to add: rats can't be litter trained with regards to peeing, just pooping. So, even if they get the hang of the litter box, they will never just pee in it.
That's only partly true.
It is true that rats will urinate while in deep sleep. This is of course involuntary and totally unavoidable. For this reason I always let them keep a couple sheets of fresh toilet paper or paper towels in their beds (read replaceable card board box or washable hammoc). They will actually take the sheets and lay them down on their beds where they are going to sleep themselves.
Otherwise, if rats have good houskeeping habits, they will pick one or two places to urinate in the cage and just stick to those places. Now those places will usually not be in the litter box because most rats instinctually don't like to urinate where they deficate. However, some rats, given two litter boxes filled with two different materials will pick one to defecate in and one to urinate in.
Now, dribbling is different from urinating and is also unavoidable to a point. But there are certain things that we all know encourage it and certain things that discourage it. For instance, an overly clean cage encourages it. Or, an environment with competing smells (other animals, detergents, perfumes...) can encourage it.
My rats didn't become as organized as they are now until they were full adults. And then I introduced a rescue who had to learn everything from the other. So it's not going to happen overnight. Also, you can't "teach" good habits to rats the way you can to a dog or a cat, using praise or disapproval. They don't care. You can suggest things by moving their pellets into their litter box. But basically it's just a matter of letting them fulfill their own instincts (which are very good where hygiene is concerned) by providing them with the right space.