Can a judge allow 2 children to live in 2 different states at periods of time?

Yes,

3020. (a) The Legislature finds and declares that it is the public policy of this state to assure that the health, safety, and welfare of children shall be the court's primary concern in determining the best interest of children when making any orders regarding the physical or legal custody or visitation of children.

for more info see www.steveshorr.com/custody.htm