Some dogs start squinting in sunny weather as they age. It’s almost always nothing to worry about. There’s a sphincter muscle in the iris (the part that gives the eye its color), and it normally takes down the size of the pupil (the dark circle in the middle of the eye) to let in less light when the sun is shining bright. But as a dog ages, the sphincter muscle may not work as well, and too much light gets in. Ergo, the squinting.
While it’s generally a benign sign of aging, if your dog has started squinting even in cloudy weather, you might want to consider getting him sunglasses in the form of protective goggles to keep him more comfortable.