You can not "give" custody of a unborn child.
After the child is born, the parent keeping the child will file in court for sole custody and the other parent does not fight it. The non custody parent will still have rights for visitation and also obligation to pay child support.