The house of mother is 4th and of the father is 9th. The karaka of the mother is moon and of the father is sun. The placement of separative planets i.e. Sun, Saturn, Rahu, mars and Ketu in these houses shows the possibility of separation from father or mother. The Karakas are also afflicted and weak in strength.
The time period is when the dasa period of seperative planets are in operation.
If the dasa period shows a combination of houses 3 and 9, custody goes to the father and if the combination shows houses 4 and 8, custody goes to the mother. If the combination shows 3 and 8 in houses, custody goes to persons other than parents. This may happen when the father or mother re-marries and the child stays with the grandparents or maternal uncle.
To conclude, when such a situation arises, the science of astrology can help parents to take decisions which are for the betterment of their child.