Does your horse shake its head only when ridden?
In horses that toss or shake their heads only when ridden, the problem may be caused by pain or discomfort. Does the behavior occur when the horse is asked to flex or work in a collected frame?
Does the behavior persists while a trainer or more advanced rider gets on the horse?
Does your horse shakes his head only while wearing riding gear and tack (like tie-downs, martingales, side reins, etc)?
Does your horse shake his head only while exposed to bright light?
Subtle lameness or back pain can be a cause of head tossing as the horse tries to find relief from discomfort. If the behavior occurs when the horse is asked to flex or work in a collected frame, thus having an AMRT (Acupuncture, Muscle Release Therapy) session may benefit your horse in releasing tension and aiding in eliminating the head shaking.
If the horse goes well for a trainer or more advanced rider then you may have been too rough with him. A subtler touch on the reins may eliminate head tossing.
Any bit of riding gear and tack should be properly fitted so that it does not pinch the horse’s mouth. If you aren’t certain the bit is the right size or in the right position, ask a professional for help.
Have an equine dentist do a thorough oral exam to make sure the teeth do not have sharp points or edges that are irritated by the pressure or position of the bit. In young horses, the shallow-rooted wolf teeth sometimes interfere with the bit and can easily be removed by a qualified dentist or veterinarian.
Some horses are sensitive to strong sunlight. Exposure to bright light causes a nerve to send a shock-like sensation to the horse’s face, and he reacts by violently flinging his head up and back. A horse with this condition, called photic head shaking, may also sneeze or snort frequently, and may try to rub his nose or face against his legs or other objects. Affected horses like to stand in the shade or at least keep their heads shaded by a barn, hedge, or pasture buddy. Some owners have found that the behavior stops if the horse wears a facemask to shade the eyes.
Other reasons for head tossing or shaking may be high energy levels at the beginning of the ride or resentment of whip or spurs. A turnout or longeing before a ride can help an energetic horse settle into his work. A trainer may be able to evaluate the use of, and the horse’s response to, spurs and whip.
https://www.animal-mrt.com/blog/post/8300/Head-Shaking-in-Horses/

Sreten null
Hi! I’m Sreten Filipović. I graduated from the Faculty of Agriculture at the University of Belgrade, with a master's degree in Environmental Protection in Agricultural Systems. I’ve worked as a researcher at Finland's Natural Resources Institute (LUKE) on a project aimed at adapting south-western Finland to drought episodes. I founded a consulting agency in the field of environment and agriculture to help farmers who want to implement the principles of sustainability on their farms. I’m also a founding member of the nonprofit organization Ecogenesis from Belgrade whose main goal is non-formal education on the environment and ecology. In my spare time, I like to write blog posts about sustainability, the environment, animal farming, horticulture, and plant protection. I’ve also published several science-fiction short stories.
You can find me on LinkedIn at https://www.linkedin.com/in/sreten-filipovi%C4%87-515aa5158/