Legal vs physical custody
California distinguishes legal custody (decision-making for health, education, welfare) from physical custody (where the child lives). Each can be sole or joint, and the two often differ — joint legal custody with primary physical custody to one parent is a common arrangement.
What courts weigh
Beyond the statute, judges look hard at stability — schools, friends, routines — and at each parent's willingness to support the child's relationship with the other parent. The latter matters more than most parents realize when they walk in.
Modifications
A custody order can be modified later when there has been a substantial change of circumstances. The standard is intentionally protective of stability — courts disfavor frequent changes — but real changes (relocation, safety concerns, a child's own evolving needs) do warrant revisiting the order.