Excommunication, as you perhaps know, does not mean being “kicked out of the church.” Most people who are excommunicated are still welcome to worship with us. It’s just that in some cases of serious sin, a person needs to have their baptism revoked so that they can repent. Then they can come back to the church and be re-baptized. Many people who are excommunicated overcome their challenges and return to the church with full blessings.
Whether or not a person is excommunicated depends in large part on the revelation that their local church leaders receive for them from God. It’s difficult to say, then, that a given sin will always get someone excommunicated. There are a few general rules, however. Wikipedia actually provides some useful information:
“Excommunication is generally reserved for what are seen as the most serious sins, including committing serious crimes such as murder, child abuse, and incest; committing adultery; involvement in or teaching of polygamy; involvement in homosexual conduct; apostasy; participation in an abortion; teaching false doctrine; or openly criticizing church leaders. A 2006 revision to the Handbook states that formally joining another church constitutes apostasy and is an excommunicable offense; however, merely attending another church does not constitute apostasy.”