Radiolab did an interesting piece on gender and sports a couple years back.
https://www.wnycstudios.org/podcasts/radiolab/articles/dutee
Gender is a nuanced thing, and there's no way to definitively divide people into the male and female categories.
The episode explores the story of Dutee Chand, a professional sprinter who for a time was not allowed to compete as a women due to her hyperandrogenism, a condition that leads to unusually high levels of testosterone.