His statement, “or for permanent residence, then custody belongs to the mother,” means that if the journey is short and is undertaken for permanent residence, custody in this case belongs to the mother. The reasoning is what has preceded: a nearby town is treated as though one were present, so the matter remains as it was.
To summarize:
First: If the journey is distant and undertaken for permanent residence, custody belongs to the father, subject to the conditions mentioned previously.
Second: If the journey is short and undertaken for permanent residence, custody belongs to the mother.
Third: If the journey is distant and undertaken for a temporary need, then according to the author, custody belongs to the mother; according to the school of law, it belongs to whichever of the two parents remains resident.
Fourth: If the journey is short and undertaken for a temporary need, then according to the author, custody belongs to the mother, while the school of law holds that it belongs to whichever of the two parents remains resident. The view closer to what is correct in this matter is that custody belongs to the mother.
You should know that in all these matters, the welfare of the child in custody must be considered before everything else. If going with either parent, or remaining with either of them, would harm the child in his religion or worldly life, then he is not to be left in the custody of one who will not protect or properly care for him. For the fundamental purpose of custody is to safeguard the child from what would harm him and to attend to his welfare.