Only a court order creates legal custody. If there is no court order, there is nothing for a judge to enforce, and each parent is free to take the child at any time.