All states require a spouse to be a resident of the state -- often for at least six months and sometimes for as long as one year -- before filing for a divorce there. Someone who files for divorce must offer proof that he or she has resided there for the required length of time. Only three states -- Alaska, South Dakota, and Washington -- have no statutory requirement for resident status. In other words, being a resident at the time you file is enough.
If you think that your spouse may file for divorce in another state, it may be prudent to spend the money up front and file first -- in your home state. Rarely is a divorce settled in one court appearance, and, if your spouse files elsewhere, you could rack up a lot of traveling expenses. Also, any modifications to the divorce decree, including the property settlement agreement and arrangements for child custody and support, must be filed in the original state. This could keep you traveling out of state for years to come, especially if you have children with your spouse. (Get more tips on the divorce process in Nolo's How to Divorce topic.)