While there may be a genetic component to homosexuality, same-sex sexual behavior is not determined by a single gene.
The largest study conducted on homosexuality and genetics to date, published in Science in 2019, identified five spots on the human genome that are linked to same-sex sexual behaviour, but cautioned that none of the markers are reliable enough to predict someone’s sexuality. After comparing the genomes and sexual behaviors of nearly half a million people, authors estimated that genetics explains 8% to 25% of homosexuality, with the rest influenced by environmental and cultural factors. The study did not find that homosexuality was associated with a stretching of DNA on the X chromosome, as a small study from 1993 had.
A study published in Nature in 2021 suggested that the mating advantages of risk-taking behavior, which authors found to be genetically correlated with same-sex sexual behavior, could explain how homosexuality persisted as a trait despite contradicting the evolutionary principle of reproduction.