I feel unlucky. How would you behave if you were gay and you lived in a country that criminalized homosexuality?

and People do not accept homosexuals? I live in this situation.

I’m so sorry you live in a situation in which being your authentic self is criminalized and not accepted. To the extent you can do so safely, reaching out to other people in your own country, or gay people outside of your country, might help. Here’s an organization that might help you do that: https://ilga.org/. I hope you can access it in your country without fear of reprisal.