Until the mid-1800s, fathers were favored for custody in the event of a divorce because children were viewed as property, similar to the farm or family business when a couple divorced. Around 1850, most states switched to following the Tender Years Doctrine or a strong preference for the mother unless there was something very wrong with her, such as mental illness, alcoholism, or an abusive relationship with her child.
Under the current law of almost all states, mothers and fathers have an equal right to custody. Courts are not supposed to assume that a child is automatically better off with either parent. In a contested custody case, both the father and mother have an equal burden of proving to the court that it is in the best interest of the child that the child be in his or her custody.
In some states, courts say that mothers and fathers are to be considered equally, but have held that it is permissible to consider the age or sex of the child when deciding custody. That usually translates to a preference for mothers if the child is young or female, although it is possible for fathers in these states to gain custody, even when the mother is fit.
SOURCE: American Bar Association