Actually, you can quite easily tell if somebody is gay or not if you know what to look for. It's called Gaydar.
At any rate, how would somebody be able to tell such a thing before somebody would have been able to make any decision on the matter? Say, like age 6.
Yeah, because a thing actually exists. Not.
A good way to find out why is to simply ask them. 90% of the time it's due to some form of abuse, drama, peer pressure, or experimenting as a kid. in one rare answer, a person learned that she was actually a male when she was born but her parents wanted a girl and gave her a love change. Was that unethical? Oh you bet. Did it explain why she was gay? Definitely. Was it anything related to genetics? Not in the least bit.
Secondly a 6 year old is not recognized as being capable of making well informed choices about themselves or about anything in their environment. They can say they're gay, but never know what it really means until they're older. They only assume so because calling someone gay is a universal insult and some people take it seriously.