united-states
In general
Is there a uniform rule on where a spouse can file for divorce? I can
see 4 possible jurisdictions:
Where the couple married
Where the filing spouse lives
here the non-filing spouse lives, if different from #2
Random jurisdiction not #1-3 (I assume the answer is a clear "no" based on common sense, but no idea what the actual rules are)
Location 1, the place of marriage, is irrelevant to where a divorce can be filed in the United States. (The law of the place of marriage at the time the marriage was formed is relevant, however, to the legal preliminary question in a divorce of whether the couple is married or not in the first place.)
Divorce can be filed for in the U.S. unilaterally by either spouse in locations 2 and 3, subject to state law residency requirements which vary someone from state to state (usually, but not always requiring a month of residency in the state by at least one of the spouses).
Divorce can also be filed for in location 4 if both spouses consent and state law permits them to do so. As a practical matter, filings in location 4 by mutual consent are usually in another county within the same state that has a less crowded divorce docket, rather than within a different state, since most U.S. states require one spouse to have lived in the state for at least a month, as a matter of state statute. New Jersey's law on this topic, for example, is explored in another Law.SE answer.
The jurisdictional analysis for a legal separation action that does not seek to end the marriage are generally identical, or very nearly so.
This answer does not consider the more esoteric question of when a court has jurisdiction to hear a proceeding to legally (as opposed to religiously) annul a marriage. It is conceivable that the place of the putative marriage might be relevant to the question of jurisdiction over an action to annual that marriage. But there is much less case law on the subject, because annulments where any doubt exists over which state has jurisdiction over the matter are much less common than divorces and legal separations that present jurisdictional issues.
This question also does not address the technical and tricky question of which court has jurisdiction over post-decree matters in a divorce, which can arise years later, when the original divorce decree does not state that the original divorce court retains jurisdiction over the case, or how the original divorce court can otherwise be divested of jurisdiction over the case. I've seen two different courts reach opposite and contradictory conclusions on this issue in one case that I litigated that had to be resolved in parallel cases before an intermediate court of appeals.
Service of process considerations in divorces
There is a related issue of service of process which is necessary for a valid divorce lawsuit.
A marriage can be terminated and property within the forum state can be divided, even if the non-filing spouse can only be served with process by publication and mail to the last known address of that spouse rather than by personal delivery of the divorce papers to the other spouse, subject to some minor exception rules (which is called "personal service"; personal service can also be made by certain other substituted form of service devised by the court or authorized by court rule, which are intended to definitely provide actual notice of the lawsuit to the non-filing party).
Granting a divorce in which the other spouse may not be aware of the proceedings, can't be found, or is non-responsive is not particularly troubling in terms of due process concerns these days now that unilateral "no fault" divorce is available as a matter of course in every U.S. state, even if the non-filing spouse objects.
This rule exists because these forms of relief are considered to be in rem proceedings (relating to things including the intangible thing of the marriage itself, rather than imposing abstract legal obligations on persons for which in personam jurisdiction is required).
Alimony awards and division of property outside the state can only made in a divorce case if the non-filing spouse has been personally served with the divorce papers. These kinds are relief are called in personam remedies.
Child custody, paternity, and child support case jurisdiction and service of process
If there are minor children whose custody is at issue, a different set of statutes (the state law Uniform Child Custody Jurisdiction and Enforcement Act - a model law enacted separately in every U.S. state with only minor differences from state to state deviating from those model rules, the federal Parental Kidnapping Prevention Act, and where relevant, an international treaty governing jurisdiction in custody cases called the Hague Convention on the Civil Aspects of International Child Abduction) applies.
Generally speaking, these statutes and treaties require the custody issue to be litigated in the "home state" of the child, which has a precise, more or less uniform, statutory definition, subject to various limited exceptions, although there would be three sets of complicated legislation if it was always as simple as the general rule. More specifically (per the UCCJEA link above):
To determine which state has proper jurisdiction to make an "initial
determination" of child custody, the UCCJEA proceeds in the following
order of priority:
The state which is the "home state" of the child, or was the child's home state within six months immediately before the
commencement of child custody proceedings if the child is absent from
the state, but a parent or person acting as a parent continues to live
in the state;
If no state has jurisdiction under #1, then jurisdiction is proper where the child and at least one parent have a significant connection
with the state (other than mere presence), and substantial evidence
concerning the custody determination is available in the state;
If no state has jurisdiction under #1 or #2 above, jurisdiction is proper in any state having an appropriate connection with the child.
A state having jurisdiction under #1 or #2 above may decline to
exercise its jurisdiction, and transfer it to another state if it is
more convenient for the parties, or if one of the parties has engaged
in misconduct necessitating a change.
"Home state" is defined as the "state in which a child lived with a
parent or a person acting as a parent for at least six consecutive
months immediately before the commencement of a child-custody
proceeding. In the case of a child less than six months of age, the
term means the state in which the child lived from birth with any of
the persons mentioned. A period of temporary absence of any of the
mentioned persons is part of the period."
Paternity cases, as distinct from custody cases involving children whose paternity is undisputed, can be brought in places where a custody case could be brought, and can also be brought in the state where the child was conceived, or in the state where the father resides.
A declaration of paternity or custody case determination can be made in rem without personal service on the non-filing parent (service of process by publication and mail can be used instead), but child support cannot be awarded against a person who has been declared to be a parent without personal service of process on the non-filing parent.
Enforcement of orders out of state
U.S. states must give full faith and credit to the rulings of courts of other U.S. states, although sometimes someone seeking to enforce an out of state court order must pay a small fee to have it registered and filed in the state other than the state where the order was entered where the person filing it wants to enforce it.
Usually, however, when a spouse in a domestic relations case where there has been personal service fails to conform to a court order, this is enforced by holding the disobedient spouse personally in contempt of court for failing to do so.
There is a domestic relations exception to federal court jurisdiction
Diversity jurisdiction is not available in the U.S. in domestic relations cases and does not present a federal question for jurisdictional purposes.
All divorce, custody, and paternity cases must be filed in state courts rather than the federal courts (or in the local courts of places like the District of Columbia, Puerto Rico, the Virgin Islands, American Samoa, and Guam that are in U.S. territory but outside any U.S. state, even though they are technically federal courts).
The validity of domestic relations decisions made in non-U.S. courts in the U.S.
U.S. courts generally apply the same rules to determine if a non-U.S. court has jurisdiction to enter orders in a divorce, child custody, or paternity case. If the foreign jurisdiction was not within one of these U.S. jurisdiction rules, the foreign judgment in the case will usually not be recognized as valid by a U.S. court.
The sub-question
A sub-question is, would the other jurisdictions affect the rulings in
any way (e.g. would a NY judge decide differently because the couple
married in CA, or because one of the spouses lives in AZ)
The place of marriage is irrelevant to how the court rules (except with respect to the question of whether the marriage was entered into validly in the first place at the time).
In particular, the fact that a couple entered into a "covenant marriage" in one of the few states that has them, which allows that couple to be divorced only on a fault basis or with longer waiting periods than usual under the laws of the covenant marriage, does not prohibit another state with jurisdiction over the marriage from divorcing the couple without regard to the status of their marriage as a covenant marriage.
But, the places where the couple lived and acquired property during the marriage can be relevant. If a couple lived and acquired property while living in a community property state, many U.S. states treat that property as "quasi-community property" subject to division based upon community property-like rules for property division upon divorce, rather than under the rules for the division of property upon divorce that apply in a non-community property state where the divorce court handling the case is located.
Also, the fact that two divorcing spouses live far apart from each other is a consideration in custody cases in a divorce, but this has nothing to do with which state the spouses are located in at the time of the divorce. The issue is present if one California resident spouse lives in San Diego and the other lives just barely on the California side of the California-Oregon border just as much as it does if one spouse lives in California and the other lives in Maine.
See also the rules that apply when there is not personal service upon the non-filing spouse in the divorce case, something that often comes up when the non-filing spouse is out of state.