It used to be that they only would allow U-23s to play soccer in the Olympics.
That's men's soccer only. "In the case of men’s Olympic soccer only, FIFA and the International Olympic Committee limit tournament participation to players who are 23 years of age and younger, with only three over-23 selections permitted on each roster."