It sounds like "wry neck" which usually is an ear infection. You can read more about it here:
in the section called "head tilt." This should be treated aggressively with an antibiotic such as Baytril or chloremphenicol for a minimum of two weeks. Here's the RMCA drug chart, which shows the dosage based on the rat's weight:
You will need to take him to a vet for this-- your rat's age and weight will be a consideration for the type of antibiotics that he can have.