Regarding the repentance of a homosexual, Dr. Hatem  Al-Haj, Professor of Fiqh explains:

‘Allah (exalted is He) forgives all sins, and he put no obstacles between his servant and repentance as long as he/she didn’t reach the death rattle and the sun didn’t rise from the west.

It is good to note that there is no need for any intermediaries or intercessors as far as repentance is concerned in Islam. All it requires is for a servant to simply seek Allah’s forgiveness, give up the sin, have enough regret that will help him with his commitment to not return to the sin again, but he should never have despair from the mercy of Allah, for that could prove to be bigger than all sins.

A repentant may also be advised to relocate and find a new environment in which he will not suffer from mockery and will not be reminded of his previous sin. I would also suggest that he establishes himself in his identity as a male before getting married, so as not to cause emotional harm to his future wife.

Finally, it may also be advisable that he sees a specialist who may help him, biologically and/or psychologically, depending on his case, with confirmation into his male identity.’