Moroni 6:7–8

And they were strict to observe that there should be no iniquity among them; and whoso was found to commit iniquity, and three witnesses of the church did condemn them before the elders, and if they repented not, and confessed not, their names were blotted out, and they were not numbered among the people of Christ. But as oft as they repented and sought forgiveness, with real intent, they were forgiven.

From section: Logistics of Church Rites, Ordinances, and Procedures

From page: Moroni Finalizes the Book of Mormon