There is no automatic preference given to either spouse, working or stay-at-home. The court has to consider a range of factors in making a determination about custody. The ultimate standard that the court is guided by is what is in the best interest of the children.
For instance, if one parent is a stay-at-home parent, they may be more present in the house in the morning to get them ready for school and then again in the afternoon when the children return from school. This presence would certainly help and be considered by the court. The court would, however, also consider the other parent’s ability to be present and their ability to provide financially.