Gay names someone drawn — emotionally, romantically, sexually — to people of their own gender; long the default word for men who love men, though plenty of women claim it too.
The word did a full one-eighty. "Gay" once meant carefree, bright, showy; then, somewhere between the 1600s and the 1800s, it picked up a whiff of promiscuity — a "gay house" was a brothel. Homosexual men took that battered word and made it theirs, using it among themselves for decades before the wider world noticed. By the time straight society clocked the new meaning, in the 1950s and 60s, it was already a badge, not an insult being borrowed.
The whole point of "gay" over "homosexual" is where each word came from. One people chose for themselves; the other got handed down by doctors. "Homosexual" grew out of nineteenth-century clinical writing that filed same-sex desire under diagnosis. "Gay" grew out of the community — bars, coded speech, the quiet art of recognizing your own. That's why it stuck, and why "homosexual" now lands cold and lab-coated when it comes from an outsider's mouth.
One note on scope, because people trip on it. "Gay" leans masculine by default — women more often say "lesbian" — but neither is a rule you can enforce. Some women call themselves gay; some men don't. And the word doubles as an umbrella ("the gay community") as easily as it works as a precise label. It stretches. Let people tell you how they're using it for themselves.