There is something called the “UCCJEA” where the home state
is for an initial custody order and where the child has resided for the prior 6
months leading up to the divorce so long as one parent continues to reside in
that state.  That means that the Home
State would be the controlling state and the state that would have the
jurisdiction over the case would be heard. There are exceptions including domestic
violence issues; other emergencies including abuse; abandonment or some other
immediate need for protection where the court can at least make an initial
custody order.  However, that order is
temporary and will only be in full force and effect until the Home State issues
an order. If the Home State does not make an order, then the emergency order
can become final and the state where it was issued becomes the Home State.

There also can be some issues in terms of a protection if
one party uses inappropriate conduct in order to secure Home State
jurisdiction. The parent might have what is considered “unclean hands” meaning
that the state would otherwise have jurisdiction but may refuse to exercise it;
let’s say if a parent takes the child to another state and willfully withholds
information from the other parent in order to wait 6 months to establish
jurisdiction.