Church handbook defines the law of chastity.
"38.6.5. Chastity and Fidelity," General Handbook: Serving in The Church of Jesus Christ of Latter-day Saints, accessed May 19, 2023
38.6.5
Chastity and Fidelity
The Lord’s law of chastity is:
Abstinence from sexual relations outside of a legal marriage between a man and a woman.
Fidelity within marriage.
Physical intimacy between husband and wife is intended to be beautiful and sacred. It is ordained of God for the creation of children and for the expression of love between husband and wife.
Only a man and a woman who are legally and lawfully wedded as husband and wife should have sexual relations. In God’s sight, moral cleanliness is very important. Violations of the law of chastity are very serious (see Exodus 20:14; Matthew 5:28; Alma 39:5). Those involved misuse the sacred power God has given to create life.
A Church membership council may be necessary if a member:
Has sexual relations outside of a legal marriage between a man and a woman, such as adultery, fornication, same-sex relations, and sexual encounters online or over the phone (see 32.6.2).
Is in a form of marriage or partnership that is outside of a legal marriage between a man and a woman, such as cohabitation, civil unions and partnerships, and same-sex marriage.
Uses pornography intensively or compulsively, causing significant harm to a member’s marriage or family (see 38.6.13).
The decision about whether to hold a membership council in these situations depends on many circumstances (see 32.7). For example, a council is more likely to be necessary to help a member repent if he or she has violated temple covenants or if the sin was repetitive.
See 32.6.1.2 for when a council is required for sexual sins.
In some cases, personal counseling and informal membership restrictions may be sufficient (see 32.8).