Isn't it true that the court always grants custody to the mother?
There is no law that dictates that children should live with one parent or the other. In all cases, and only where it is necessary because the parents have been unable to reach their own agreement, the court will make a decision based on the best interests of the child.