I'm sorry. I was freaking out so much that I did not read.
My rat, Cole, is a little over 2 years old. I got him from Petsmart. His penis is swollen, purple, and will not go back in his sheath. I have never had this happen before so I do not know what to do.
He might have a penis plug. I have never had a rat that had one, I have only seen pictures. As a rat gets older some times it is hard for them to keep clean and they can have a almost waxy build up. It can be dangerous as it can back them from urinating. I know people that have applied a warm compress and then applied light pressure to unplug it, but if that isn't it you could end up doing more damage than good. I would suggest taking him to a vet very soon. If he can't urinate it could cause a bladder / kidney infection. Or kidney damage if urine gets backed up into kidneys. Good luck
First off get some vasalene, oil or lube and try and gentley massage it back into the sheath (the things we do for rats). If it wont go then get him to the vets asap, keeping it lubricated with the oil etc. If it dries out this can be very bad. If you cant get to the vets then put him on an anti-inflammatory asap, kids ibuprofen suspension is probably the easiest to get hold of, I would expect the vet to put him on metacam.
This can be cause by a few things, penis plugs are one, and are usually easy to spot and remove (look like a bit of wax, remove without thinking too hard about what it is), injury or over grooming can irritate it, you can also get a blockage in the urinary tract from something like a bladder stone or tumour.
If he isn't peeing in the next few hours it becomes an emergency and he needs to get to the emergency vet as failing to be able to pee does cause the bladder to burst internally in as little as 24 hours and that will kill them. A vet can empty the bladder using a syringe to buy you time to get to the bottom of whats blocking things up.