Before a state court can grant you a divorce, it must have jurisdiction to rule on your issues. This means you or your spouse must meet its residency requirements. It usually doesn't matter if you both live there, or only you do – if you file in a state where you've established residency, the court has the power to make decisions that involve your spouse as well.
Domicile vs. Residency
Many states use the word "domicile" in their statutes instead of "residency." There's a distinction. You and your spouse may own property in different states, but you don't actually live in all of them – one may be a vacation home or a rental property. These are residences, as opposed to your domicile. Your domicile is the place where you receive your mail, pay taxes, vote and are licensed to drive. It's where you actually live with the expectation of returning if you travel for a period of time. You must be domiciled in most states to be able to file for divorce there.
Domicile or residency requirements can vary considerably from state to state. For example, if you move to Nevada with the intention of filing for divorce there, you need only wait six weeks. This is in contrast to states like Connecticut, where you must establish your domicile for a full year, and New York, where you must live continuously for two years if you weren't married there. These are extremes; however, in many states, the residency requirement is six months.