*Legally means according to God's law. For "I speak to them that know the law" (Romans 7:1).
If a husband puts away his wife, casts her to the side like an unwanted object and goes to marry another woman, he commits adultery against her. If she, while put away from her husband, goes ahead and marries another man, she commits adultery along with that man who takes her as his wife, because she is already one man's wife; although that man put her away, she is not a legally divorced woman. (Luke 16:18; Mark 10:11)
If a woman decides to put away her husband to become another man's wife, she commits adultery. (Mark 10:12)
If a husband puts away his wife for any reason other than fornication/whoredom, and he divorces her, and goes to marry another woman, he commits adultery against her. If she, while put away from her husband and given a writing of divorcement even, goes and marries another man, she commits adultery along with that man who takes her as his wife, because she is already one man's wife, although that man put her away and divorced her. His divorce was illegal and she is still his wife. (Matthew 19:9).
If a husband puts away his wife for the reason of fornication/whoredom, and he divorces her, and goes to marry another woman, he does not commit adultery for he has legally divorced her, though he could have forgiven her. (Matthew 19:9).
Mercy triumphs over judgement. And a man having the Spirit of God dwelling in him will handle this differently. He will rebuke his wife, and if she repents of her whoredom, he must forgive her (that, I suppose, may be harder than just wiping her off his life). He must act according to the measure of his faith. But if he divorces her, on the grounds of fornication/whoredom, he does not sin. (Matthew 19:9). And if she, while put away from her husband and given a writing of divorcement, goes and marries another man, she does not commit adultery with that man who takes her as his wife, because she has been released from the bond of her marriage to the first husband. She is legally divorced and free to become another man's wife and shall not be called an adulteress (Deuteronomy 24:2).
Matthew 19:9 and Matthew 5:32 say "put away". There is no divorce there unlike suggested in Matthew 5:32.
But I say unto you, That whosoever shall put away (G630) his wife, saving for the cause of fornication, causes her to commit adultery: and whosoever shall marry her that is divorced (G630) commits adultery.
And I say unto you, Whosoever shall put away (G630) his wife, except it be for fornication, and shall marry another, commits adultery: and whosoever marries her who is put away (G630) does commit adultery.
Look up the Greek word apoluō (G630: https://www.blueletterbible.org/lang/lexicon/lexicon.cfm?t=kjv&strongs=G630).
If putting away means divorce (through the giving of an act of divorcement) why does that step need to be mentioned at all? (Deuteronomy 24:3). Also note in that verse that a "bethroted" wife would be at the father's house, not living in her husband's house. So the whoring of the wife that is mentioned (also in Matthew 5:32; 19:9) is not exclusively a so-called bethrotal period kind of whoring.
If a man who is a brother has a wife who is a sister in Christ and she departs from/separates from/leaves him (G5563), she is to remain unmarried (1 Corinthians 7:10-11). Unmarried because that departing of hers is a breaking of bonds, the very thing Jesus said not to do: "What therefore God has joined together, let not man put asunder/separate (G5563)" (Matthew 19:6). It's not that it's undoable, but Jesus said not to do it, which itself implies that man can separate "what God has joined together". She has acted as an unbeliever who doesn't know God's law, let alone have it written on her heart. Look up the Greek word chorizo (G5563: https://www.blueletterbible.org/lang/lexicon/lexicon.cfm?t=kjv&strongs=g5563).
This process can be followed to determine if she legitimaty should be regarded as a sister who will receive counsel from the body of Christ:
Matthew: 18. 15. Moreover if your brother (sister) shall trespass against you, go and tell him his fault between you and him alone: if he shall hear you, you have gained your brother. 16. But if he will not hear you, then take with you one or two more, that in the mouth of two or three witnesses every word may be established. 17. And if he shall neglect to hear them, tell it unto the church: but if he neglects to hear the church, let him be unto you as a heathen man (woman) and a publican.
We'd better learn to discern between good and evil (Hebrews 5:14), testing spirits (1 John 4:1) and be checking those fruits (Luke 6:43-45).
A brother or a sister who has an unbelieving spouse is entreated by Paul to not put that person away, that is, end the marriage. The KJV translators wrote "put her away" (G863) when it's the man doing it, and "leave him" (G863) when it's the woman, yet it's the same word used in the original text (1 Corinthians 7:12-14). The sense of that word is to forsake. Look up the Greek word
aphiēmi (G863: https://www.blueletterbible.org/lang/lexicon/lexicon.cfm?t=kjv&strongs=g863).
See if there is something you could possibly study in context and understand here:
28 Then Peter began to say unto him, Lo, we have left (G863) all, and have followed you. 29 And Jesus answered and said, Verily I say unto you, There is no man that has left (G863) house, or brethren, or sisters, or father, or mother, or wife (what's 'wife' doing here?), or children, or lands, for my sake, and the gospel's, 30 But he shall receive an hundredfold now in this time, houses, and brethren, and sisters, and mothers, and children, and lands, with persecutions; and in the world to come eternal life.
What's your relationship with the things you have left/forsaken for Jesus' sake and the gospel's? Are you still bound/attached/married to them?
But unbelievers will do what unbelievers will do. Let them.
1 Corinthians 7:15.
But if the unbelieving depart, let him depart. A brother or a sister is not under bondage in such cases: but God has called us to peace.
"depart" is the same word (G5563) as above in 1 Corinthians 7:10-11. See that note.
Jesus met a woman He said Himself has had 5 husbands (successively of course), and a present man in danger (I suppose) who was not her husband (John 4:18). Think. Who was that woman and by what manner can she be said by the Lord himself that she had had a first, and second, and third, and fourth, and fifth husband, when you also read: "The wife is bound by the law as long as her husband lives; but if her husband be dead, she is at liberty to be married to whom she wills; only in the Lord." (1 Corinthians 7:39; also Romans 7:1-3). Oh she must have killed them all! Maybe, maybe not. Find in you if possible the same wisdom and meekness that was in Jesus when he spoke to that woman. We don't know that she was an adulteress nor a murderess at that point. But let's concede, going back to her first husband is utter foolishness in that context. What that woman needed at that point and that she found was Jesus (the Word of God) to set her free and set things in order in her life, not name calling and ill advice with scripture throwing with no mercy.
At this, his disciples came. They marveled that he was speaking with a woman; yet no one said, "What are you looking for?" or, "Why do you speak with her?"
Will you speak with a woman like her?
Therefore be merciful, even as your Father is also merciful.
Not everybody is in Christ. And Jesus did not only come across or speak with people who were his disciples. If you have the mind of Christ (1 Corinthians 2:16), you can discern this and tame your tongue, seek wisdom and understanding (which you shall find if you have unweavering faith and don't assume that you have already figured it all out); then tailor your speech accordindly, learn to become all things to all men and women (1 Corinthians 9:22), rejoice with those who rejoice and mourn with those who mourn (Romans 12:15), forgive if you have been hurt in marriage, and wait on the Lord if you haven't had the opportunity to share in his sufferings yet, in marriage, in singleness or otherwise. Do not be haughty nor bitter.
2 Timothy: 2. 24. And the servant of the Lord must not strive; but be gentle unto all men, apt to teach, patient, 25. In meekness instructing those that oppose themselves; if God peradventure will give them repentance to the acknowledging of the truth; 26. And that they may recover themselves out of the snare of the devil, who are taken captive by him at his will.
These words stand as a witness against all of us who are led to speak on these matters (let us do so with good judgement):
James: 3. 1. Let not many of you be teachers, my brothers, knowing that we will receive heavier judgment. 2. For in many things we all stumble. If anyone doesn't stumble in word, the same is a perfect man, able to bridle the whole body also.
2 Peter: 2. 1. But there were false prophets also among the people, even as there shall be false teachers among you, who privily shall bring in damnable heresies, even denying the Lord that bought them, and bring upon themselves swift destruction. 2. And many shall follow their pernicious ways; by reason of whom the way of truth shall be evil spoken of.
Seek your guidance from whom you should, that is God Himself, and do not cause the way of truth to be evil spoken of nor be a stumbling block to anyone.
Romans 2:11-13, 26-27
11 For there is no respect of persons with God. 12 For as many as have sinned without law shall also perish without law: and as many as have sinned in the law shall be judged by the law; 13 (For not the hearers of the law are just before God, but the doers of the law shall be justified.
26 Therefore if the uncircumcision keeps the righteousness of the law, shall not his uncircumcision be counted for circumcision? 27 And shall not uncircumcision which is by nature, if it fulfills the law, judge you, who by the letter and circumcision does transgress the law?
I am open for discussion before the body of Christ. No need to get puffed up with our understanding and kill ourselves and destroy others over a matter hundreds of scholars pushing their PDF's left and right attempt to clarify. We can't go around, ashamed or half-ashamed of God's Law (Torah), content to study things superficially, and being unmerciful, trying to push a one size fits all rule on people regardless of who they are and their circumstances with respect to marriage, while we are too caught up in ourselves and our world to relate to them in their shoes, or perhaps to even pray and fast to seek the Lord about a particular case. Paul at least was humble to note what was his opinion on certain matters, as an unmarried man who had the Spirit of God (1 Corinthians 7:12 and following, 1 Corinthians 7:25 and following up to 38; 1 Corinthians 7:40).
Note that he said a man who forbids his virgin daughter to marry does well (1 Corinthians 7:37). Try to apprehend that with your renewed and anointed 21st century mind for a second!
God is not the author of confusion and has made his will known concerning marriage from A to Z. It is knowable. Seek it thoroughly and without bias; and especially, bring your mind outside of your own confort zone and the simplicity of your circumstances that may be no burden to you (Praise God!), or that are perhaps distressing you (O praise God still!), regardless, and learn to relate to another as you would want another to be able to do also concerning you.