Dear brother I want to know what is a homosexual? Is the man whose sex is changed or the person who do bad evil thing (zinha) with his hand?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
A person who is sexually perverted is a person who diverted from the proper Fitrah (natural disposition upon which Allah created mankind) as far as sexual relations are concerned (masculinity and femininity), like a man who desires to have sex with a man (homosexual), or a woman who desires to enjoy a woman (lesbian), or a man who wishes to be a woman while having a male sexual organ and not having female private parts. The contrary applies, like a woman who wants to change her sex despite her having only female organs and being exempt from male ones.
As regards a hermaphrodite, who is a person who carries both male and female sex organs and one of the organs is dominating and he opts for it, then this person is not perverted, as he/she has not diverted from the proper Fitrah.
As for the person who masturbates, he commits a forbidden act but he is not considered perverted.
For more benefit, please refer to Fataawa 147243, 128772 and 96291.
Allah knows best.
You can search for fatwa through many choices