It is important to remember that a person's sexual orientation is personal, and they may be reluctant to share this information. Some people are closeted for their own reasons, and outing them could put them in danger -- for example, if they live with a family that is violently homophobic. If they do decide to tell you, don't be shocked if they also choose not to share it with other friends or family members. They may not want to risk losing those relationships.
When it comes to figuring out if someone is gay, you'll need to pay attention to their actions and their body language. For example, if they are more comfortable with hanging out with men than women and prefer to use "they" pronouns, that could be a sign that they're gay. You'll also want to note how they talk about dating and their relationship feelings.
Another thing to keep an eye on is their reactions when the subject of gay rights or gay culture comes up. Depending on the person, they might passionately defend homosexuality or be antigay. It's possible that they're still questioning their orientation, but if they are open to talking about it, you might be able to help them come out.
Finally, you'll want to consider whether they ever volunteer for LGBTQ organizations or advocate on behalf of the community. This is a great way to show them that you support them, and it's a nice way to get to know them better.