Generally speaking, if your child is under say 6 years old, then s/he will still be depend on the mother a lot, so there is a higher chance the mother would get the custody of the child, but the court would put the child's best interest first above all. But if you child is older that s/he could make their own decision which parent s/he wants to stay with, the court will take that into account, but at the end of the day, the child's best interest would be the most important thing.