The only way to know if your friend is gay is to talk to them. However, it can be difficult to figure out if someone is gay because they may not want to come out to you or they might be unsure of how their family and other friends will react.
One thing to consider is if your friend seems more comfortable using the pronouns he or she or they and their instead of she or her. This can be a good indication that your friend is more likely to identify as gay. You can also pay attention to how your friend talks about women. If they seem bashful around women or are hesitant to go out with them this can be a sign that they are gay. It is important to note that just because your friend shows signs of being gay does not mean you should treat them differently or make assumptions about their character. Just be kind and respectful to them and let the rest of your relationship build naturally.
Lastly, remember that it is okay for your friend to not open up about their sexuality. If they are gay they might not be ready to tell their whole social circle, or even their best friends, yet. They could also be afraid of how their family members will react or how their closeted sexual orientation might affect their job, or relationships with other people in their life. They may need time to process these things, or they might simply decide not to come out at all.