Courts consider several factors when determining child custody, including the child's relationship with each parent, the ability of each parent to provide a stable environment, the child's adjustment to their home, school, and community, and the mental and physical health of all individuals involved.