The teachers of the law and the Pharisees brought in a woman caught in adultery. They made her stand before the group and said to Jesus, “Teacher, this woman was caught in the act of adultery. In the Law Moses commanded us to stone such women. Now what do you say?” They were using this question as a trap, in order to have a basis for accusing him.
In fact Mosaic law does not instruct them to stone an adulteress. Stoning is the Biblical punishment for a betrothed virgin who is sexually unfaithful to her fiance and is to be meted out to both partners Det 22: 23-24 If a man happens to meet in a town a virgin pledged to be married and he sleeps with her, you shall take both of them to the gate of that town and stone them to death and in fact although stoning is a current punishment in some Muslim countries it was not a punishment in Judaism in the first century AD.
Adultery is a capital Offence under Mosaic Law (Lev 20:10)If a man commits adultery with another man’s wife—with the wife of his neighbor—both the adulterer and the adulteress are to be put to death. But this was not a punishment carried out under Roman occupation.