Unfortunately, here's no way anyone here can give you a diagnosis, we can only guess. Only a vet who sees him will be able to tell you what it is and treat him.
It could be a few things, as CD said, ear mites, allergies, fleas, stress.... My guess would be ear mites but I think you need to bring him into a vet and get it checked out. He must be very uncomfortable and more than likely it's easily treated.
Good luck and let us know how he's doing!