Obviously, the man for whom the paternity is established will be considered the father of the child and he will have guardianship over the child as well. The child will inherit from this man and using this paternal relationship, Nikah rules will be decided i.e. those relations with whom this child may marry and those whom this child is prohibited from marrying.
If the sperm of the husband and the ovum of an entirely unrelated woman (not his wife) are mixed and the embryo is implanted in the womb of this man’s wife, then even though it is prohibited and forbidden, this man will be considered the father of the child as he is the one whose sperm were used and also the master of the bed. His wife will be considered to be the mother of the child as she has given birth to the child. Allah Ta’ala has declared those women to be mothers who bear the stress of pregnancy and the agony of delivery, as given in the Holy Quran:
Their mothers are only those who have given them birth. Surah Mujadalah (58:2)
The lady who participated in this birth will not be considered the mother of that child, still caution demands that the child must not marry that lady or her progeny. In other impermissible cases, the ruling will remain the same. Unrelated men and women from whom sperm and ovum has been taken will not be considered the parents, as we now know, but there will be a prohibition of marriage. That child cannot marry that person and cannot marry the elders and the progeny of that man/woman, as in Fiqh Hanafi, Nikah prohibitions come into force even with an adulterous relationship.
We pray to Allah Ta’ala that for the sake of the Holy Prophet (Sallallahu alaihi wa sallam), He grant all Muslims chastity and guide all Muslims to perform Nikah and all other affairs of life as per the Shariah.
********