Divorce
With few exceptions, a judgment of dissolution of marriage may not be entered unless one of the spouses has been a resident of the state of California for six months and resident of the county where the divorce is filed for three months prior to filing. You do not need to live with your spouse, or even live in the same county as your spouse to file for divorce. So long as one or both of you have resided in the county where the petition is filed for at least three months, the court can hear your case.
Legal Separation
If neither you nor your spouse meet the residency requirements to file for divorce in California, as an alternative, you can file a petition for legal separation. While a petition for legal separation does not terminate your marital status, legally it allows for the resolution of the same issues in a divorce. Additionally, once you meet the residency requirements, you can amend the petition and ask to terminate marital status.