We don't know enough to know from the facts in the question.
Which state's laws take precedent?
The question of which jurisdiction's law to apply to a particular legal question is call a "choice of law" question.
As the issue presents itself, the law of the state in which a judge is deciding a choice of law question (called the "forum state" which could be any of multiple possible jurisdictions that have jurisdiction to hear the case), presumes that the applicable law to a legal issue is the law of the forum state unless a party argues otherwise to the judge. So, getting to court first in a favorable forum court jurisdiction can be a key litigation tactic when choice of law issues are potentially implicated.
Generally, truly procedural issues are always a question governed by the law of the forum state.
But for substantive law issues, the modern rule in most U.S. states is that the law governing a legal issue presented in a case is governed by the law of the state with the most significant relationship to the issue, in a multi-factor wholistic analysis that considers the connection of each of the parties to the state and the connection of the underlying facts giving rise to the dispute to the case. The most significant relationship analysis is a highly fact specific inquiry for which all manner of connections between the proposed state's law, and the parties, and the legal issues are considered.
Choice of law rules are generally considered to be procedural issues, at least, unless a contractual choice of law provision states otherwise.
It is not always obvious, however, what constitutes a procedural rule and what constitutes a substantive rule. Federal courts in diversity jurisdiction cases make this distinction under what is called the Erie Rule and there is considerable detail exploring which rules are procedural and which are substantive. State courts in a case where another jurisdiction's substantive law might apply engage in a similar analysis.
Notwithstanding this general rule, there are statutory and case law exceptions, and a judge in the forum state will not apply a rule of law that is squarely contradicted by a public policy of the forum state.
Sometimes the laws of multiple states are applied to different legal issues in the same case, a concept called "dépeçage".
The modern multi-factor balancing "most significant relationship" doctrine started to enter wide use in roughly the 1960s and replaced a "traditional" set of choice of law rules in which bright line rules determined which jurisdiction's laws applied to different kinds of cases, in the absence of an affirmative mutual choice of law by the parties (for example, in a contractual choice of law clause).
Some of those bright line rules still have considerable force. Real property law issues are almost always decided based upon the law of the place where the real property is located. The internal governance issues of a legal entity formed under the laws of a state are predominantly governed by the laws of the state of formation. Disputes concerning trustees and beneficiaries and settlors of trusts are mostly governed by the law of the place where the trust is primarily administered. Most probate issues (except those applying to out of forum state real property) are governed by the law of the jurisdiction where the decedent is domiciled at death. Traffic law and criminal law is predominantly governed by the law of the jurisdiction where the alleged violation of those laws took place.
In tort and contract law, choice of law analysis has been more strongly governed by the modern "most significant connection" rule.
Historically, tort cases were governed by the law of the place where the tort was committed.
In contract law, the traditional rules were to look to the law either of the place where the contract was formed (typically, the place where the person accepting an offer to make a contract was located when the contract was executed), or the place where the contract was to be performed.
The aggregate effect of the modern rule relative to the traditional rules for choice of law is that courts end up applying the forum state's law more often than they did under the traditional rules.
But this is also partially due to the fact that in the post-WWII era, when the modern choice of law rules were adopted, a series of court decisions made it much easier to bring a lawsuit against someone in the place where the events giving rise to the lawsuit arose, rather than the place where the defendant was domiciled (as a concept called "long arm jurisdiction" was widely adopted and given U.S. Supreme Court approval). So, some of the shift to a selection of forum state law reflected the fact that the forum state was more often the state with the most significant relationship to the case than was historically the case.
There are also some areas of law that are governed by very specific statutory choice of law rules, most notably, choice of law questions arising under the Uniform Commercial Code, and choice of law questions related to child custody (in which there are parallel federal and state laws plus an international treaty or two, the state laws are almost completely uniform, and the laws were designed to complement each other).
I've seen some contracts say something along the lines of "in case of
a dispute this contract should be interpreted by [states] rules." Is
that legally binding if the other state wouldn't usually respect the
This is usually binding, unless applying the law of the state other than the forum state selected would violate a strong public policy of the forum state which could not be contractually waived in the forum state.
Could I do that even if neither signer lived in a state if I wanted to
take advantage of that states legal precedent?
Usually only if the contract or the parties have some meaningful connection to the state whose law is chosen, although arbitrators will often respect a choice of forum even if the parties have no connection to the place whose law is chosen to apply.
It is also not uncommon in business to business commercial transactions (such as letter of credit transactions), especially international ones, for the parties to elect that their contract be governed by a set of highly specific contractual provisions that substitute for legal precedent on most key issues between the parties by incorporating by reference a commercial standard form of boilerplate terms.
Lets say person A and person B sign a contract, in which person A
signs away their right to a financial claim. The two people live in
different states, and one state has a precedent for respecting this
type of contract and the other state doesn't allow signing away legal
rights in that manner then what happens if person A tries to claim
their financial claim they signed away?
A typical modern choice of law analysis would begin by asking if the state where the person signing away legal rights was protected by the law of their own state (strengthening the argument that it should not be enforced), or by the laws of the other party's state. It would ask what the source of the public policy invalidating this kind of waiver was, and how strong that public policy was. It would ask where the events giving rise to the financial claim arose, where the contract was agreed to by each party, who wrote the contract, and where other parts of the contract were to be performed. It would also consider where someone chose to sue.
From the perspective of parties evaluating their rights under a contract that is not yet in litigation, the choice of law question is uncertain (because there are significant ambiguities in how the modern rule applies to particular facts, and sometimes even in how the traditional rules apply to particular facts), and is indeterminate, and unknowable in many cases (in part because the forum in which the question will be decided is not known in advance).
Different states have different choice of law rules. Some states cling to the traditional rules in particular areas of law. Some states use the modern rule in particular areas of law. All states have precedents regarding how their choice of law rules are interpreted, but in many states there are lots of questions of first impression not governed by any precedents that are closely on point.
Sometimes, you can do an analysis of the choice of law issues in every possible forum and conclude that they would reach the same conclusion on the merits in every possible forum. But, if this is not the case, the parties won't know what substantive law governs their contract until an actual dispute arises and somebody brings a lawsuit.
This is why it is better practice to draft such contracts with a clearly stated choice of law and to confirm that there isn't a law in one of the states that could be a forum for resolving the dispute that would invalidating the contract as a matter of public policy.