Code of Alabama
Article 1 - General Provisions.
Section 30-3-1 - Custody and Education of Children Upon Grant of Divorce; Custody of Children Where Wife Abandons Husband.

Upon granting a divorce, the court may give the custody and education of the children of the marriage to either father or mother, as may seem right and proper, having regard to the moral character and prudence of the parents and the age and sex of the children; and pending the action, may make such orders in respect to the custody of the children as their safety and well-being may require. But in cases of abandonment of the husband by the wife, he shall have the custody of the children after they are seven years of age, if he is a suitable person to have such charge.