Dear Sheikh, As-Salamu `alaykum. In case of divorce, which one of the spouses is entitled to taking possession of the house and gaining the child custody? Jazakum Allah khayran.
Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Dear questioner, we would like to thank you for the great confidence you place in us, and we implore Allah Almighty to help us serve His cause and render our work for His Sake.
In case of divorce, be it raj`i (revocable) or ba'in (irrevocable), the wife must spend a period called `iddah during which she must stay in the marital home. She must never desert that house nor does her husband has a right to drive her out of it. This is based on Allah's saying: "O Prophet! When ye (men) put away women, put them away for their (legal) period and reckon the period, and keep your duty to Allah, your Lord. Expel them not from their houses nor let them go forth unless they commit open immorality. Such are the limits (imposed by) Allah; and whosoever transgresseth Allah's limits, he verily wrongeth his soul. Thou knowest not: it may be that Allah will afterward bring some new thing to pass." (At-Talaq: 1)
Thus, during that period (which implies the continuation of marriage), the wife must stay in the marital home. The wisdom behind that is to provide an opportunity for the spouses to re-tie the knot legally. However, if that period elapses, the wife must leave the house.
The wife gains the right of child custody until she gets married, then that right is passed on to her mother then to her mother in-law then to the husband.
Finally, since the preparation of the marital home is the duty of the husband, then divorce does not render the husband forsaking the marital home.
Allah Almighty knows best.