Child custody is determined based on the best interests of the child. Courts consider factors such as each parent’s ability to provide for the child’s physical and emotional needs, the child’s relationship with each parent, and the child’s preferences if they are old enough.