My dog, a basenji/beagle mix, was shaking her head a lot. I looked in her ears to see if there was redness (an infection) or a black appearance (mites), You should smell his ears because infections produce a bad odor. You can treat mites with over-the-counter treatments from pet stores. My dog appeared fine. I took her from vet to vet and they all said her ears were healthy. I took her back to the regular vet and told him I want a routine dental cleaning. While her mouth was propped open and she was sedated he saw a large mass in her jaw. It turned out to be a very aggressive cancer and he removed as much as possible. The pressure was causing her to shake her head. The vet put her on Rimadyl and she was able to live pain-free for another 5 months. The head-shaking stopped. She had been miserable with it. So, I suggest that you look for a low-cost vet (call your local humane society for ideas) that you can afford and have someone look at your dog, unless you can diagnose and treat the problem. You shouldn't let him suffer. I am on a small pension and watch every penny, but I would have sold my soul to get help for my dog.
Yup, he needs his ears looked at and simple treatments will take care of it 99% of the time. Avoid lots of tests etc at the first go with the vet. Exam, clean, meds for home use and keep the ears clean at home.
I would take him to the vet and ask them to check for ear mites. If it's not mites, it could be a build-up of ear wax down in the ear canal, and if so, the vet has products that you can use to regularly clean his ears. It could also possibly be an ear infection.