All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
If you are sure that your husband is homosexual, then you should advise him and remind him of Allaah and of His severe Punishment in this life and in the Hereafter for whoever commits this act; look how Allaah punished the people of Loot (Lut) because of this abominable act.
As regards the treatment of this, then it is easy for whoever Allaah made it easy for him. If your husband really wants to get rid of this bad habit, then he has to be sincere with Allaah, and he should be really determined to refrain from it, as Allaah does not forsake whoever is sincere with Him; Allaah Says (what means): {As for he who gives and fears Allaah. And believes in the best [reward]. We will ease him toward ease.}[Quran 92:5-7] Besides, the Prophet said about one of his companions: “He was true to Allaah, so Allaah was true to him [i.e. fulfilled his needs].” [Abdur-Razaaq]
Moreover, he should earnestly supplicate to Allaah as much as possible; Allaah Says (what means): {And when My servants ask you, [O Muhammad], concerning Me-indeed I am near. I respond to the invocation of the supplicant when he calls upon Me.}[Quran 2:186]
In addition to this, he should avoid the bad environment that helps him to commit this sin, and he should be keen on keeping company with righteous people. It is reported in a Hadeeth that a person killed 99 persons and he wanted to repent, so a scholar told him: “Go to such and such land as there are people who worship Allaah there, so worship Allaah with them, and do not go back to your land, as it is an evil land.” [Muslim] For more benefit, please refer to Fataawa 90562 and 88137.
It should be mentioned here that residing in a non-Muslim country could be a means of much temptation, so if you are able to migrate to a Muslim country, then you should do so, as this will help your husband to repent. For more benefit on the ruling of migration from a non-Muslim country, please refer to Fatwa 86405.
Then, if this man repents and becomes righteous, praise be to Allaah, but if he persists on his situation, then you have the right to ask for divorce, and if you wish, you may be patient with him and endeavor to rectify him. If you advise him, then you would have done what is required from you. We hope that you and your daughter will not be cursed because of his act, as no bearer of burdens will bear the burden of another. For more benefit, please refer to Fatwa 117370.
If we presume that divorce takes place, then you have the legal right to foster this daughter, and if you remarry, the fostering will be transferred to the female who has more right in fostering her after you, like your mother. As regards her father [your husband], he has no right to foster her as long as he is on this situation due to his dissoluteness. For more benefit, refer to Fatwa 90461.
Moreover, he is obligated to spend on her whether he is the one who fosters her or it is you who fosters her; this is the religious ruling and the law should not be taken into account if it contradicts the Sharee’ah.
Allaah Knows best.