I’m around 6’2″ and would ride either a 19″ or 20.5″ bike from our hire fleet. My own hardtail is a 19″. If I’m riding full-sus I’d tend to go large, rather than XL.
22″ bikes are huge, and I’d generally only suggest that sort of size for very tall folk, 6’6″ and upwards.
But, people prefer different sizes, and different manufacturers measure different things – so hard to say for sure what size you need.
If you were hiring from us, based on your height and no other info, we’d put you on a 19″ though.