The court applies the "best interests of the child" standard when making custody decisions, and must consider the following factors:
The "fitness" of the parents to have custody.
The character and reputation of the parties.
The desire of the natural parents and any agreements between them.
The ability to maintain natural family relations.
The preference of the child -- when the child is of sufficient age and capacity to form a rational judgment.
Material opportunities affecting the future life of the child.
The age, health, sex of the child.
The suitability of the residences of the parents, and whether the non-custodial parent will have the opportunity to visit.
How long the child has been separated for the parent who is seeking custody.
The effect of any prior voluntary abandonment or surrender of custody of a child.