The Son is for the Second Husband and the Missing Husband has the Right of Option.
A husband was missing for a long time, to the point that the wife had thought that he had died. His wife, therefore, married another man and had a child from him. After some years, the first husband returned. Does his wife now stay with the second husband or is that marriage dissolved? Does the first husband have the right to ask for his wife back? If he does, do they have to perform a new contract?
This is the issue of the marriage of the wife with a missing husband. [This is the case where] the husband is missing and searched for over along period of time, it is concluded that he is dead, the women marries somebody else and then the husband reappears. He then will have the choice of keeping the new marriage in tact or in having his wife returned to him. If the new marriage is left intact, the matter is clear. The contract is valid. If he does not choose that and he wants his wife back, the wife is returned to him. However, he cannot have intercourse with her until she finishes her waiting period from the second husband. There is no need to make a new contract for the first husband because there was nothing that invalidated the previous contract. As for the child from the second husband, it is a legal child and will be ascribed to its father because the child was the result of a proper marriage.
Shaykh Muhammad bin Saalih al-`Uthaymeen
Islamic Fatawa Regarding Women - Darussalam Pg. 199-200