Mineral sun creams (where the UV protection ingredients are zinc oxide or titanium dioxide) are the best as they tend to cause less sensitivity around the eyes and are tolerated better. Matte formulas (mineral sun creams anyway tend to be more matte) are also better so that they are less likely to drip into the eyes with sweat.
Fragrance and alcohol are the two key ingredients to avoid - they can be super irritating to many eyes. But really the trick is to try to look for a sun cream that won't get in the eye at all - that's why matte formulas are always our go-to.
Powder formulas can also work well but just make sure that your eyes are very tightly shut when applying them, as we know loose powder, especially talc, can disturb the tear film. If you have particularly sensitive eyes try patch-testing a small amount just above the eyebrow to get a sense of how your eyes will react.
Many of the ingredients that make sun creams effective at protecting the skin from UV are irritating to the eye. Fragrances, preservatives, certain UV-protecting ingredients (specifically oxybenzone and octinoxate), and alcohol, are all eye irritants.
Sun cream is also often a different pH to that of our tear film (they can be around pH 5-7 whereas our tear film is around 7), so this difference can also account for the stinging.