Praise be to Allah.
With regard to custody, if the former spouses came from different cities, the basic principle concerning custody – so long as the child has not yet reached the age of seven – is that the mother has custody, because the Prophet (peace and blessings of Allaah be upon him) said: “You have more right to it so long as you have not remarried.” Narrated by Abu Dawood, 1938. This is the basic principle.
But there is another principle, which is that the matter of custody is based on whatever is in the best interests of the child. If travelling with his mother or father will be harmful to the child, then custody should be given to the parent who will not harm the child by travelling. If the mother’s travelling to another city will not have any harmful effects on the child, then the basic principle is that custody is hers.
With regard to referring to the courts of a non-Muslim country to resolve the matter of custody, that is not permissible, because this is referring to taaghoot (falsehood, false judges) for judgement, and Allaah says (interpretation of the meaning):
“And whosoever does not judge by what Allaah has revealed, such are the Kaafiroon (i.e. disbelievers — of a lesser degree as they do not act on Allaah’s Laws)”
“So judge among them by what Allaah has revealed, and follow not their vain desires, diverging away from the truth that has come to you. To each among you, We have prescribed a law and a clear way”
The two former spouses should go to the Islamic center and ask the scholars or knowledgeable people there to judge between them.
If the woman remarries, she loses the right to custody, because of the hadeeth quoted above. See also question no. 9463.