I have been instructed for years that only baptized members will get into the Celestial Kingdom.
Those people that are valiant in that good works will get into the Terrestial Kingdom.
And all the unrepentant sinners will go to the Telestial, apart from the rare sons of Perdition.
For much of my member life I was instructed that church courts were conducted by inspiration and that all decisions were thus correct. This meant that all excommunicated members were unable to obtain the Celestial Kingdom without repentance and re-baptism.
Yet over latter years I have come to see problems with this simplistic viewpoint. Also personal guidance by the Spirit brought some of it into question. And recently a Scripture text was pointed out that supported that guidance.
The message of this text has significance to the excommunicated members who were never guilty of the sins of which they were accused, but were still found guilty by church courts. Sad as it may be, and as much as we may like to believe otherwise, it is far too prevalent.
"The heavens were opened upon us, and I beheld the celestial kingdom of God, and the glory thereof, whether in the body or out I cannot tell....I saw Father Adam and Abraham; and my father and my mother; my brother Alvin, that has long since slept; And marveled how it was that he had obtained an inheritance in that kingdom, seeing that he had departed this life before the Lord had set his hand to gather Israel the second time, and had not been baptized for the remission of sins. Thus came the voice of the Lord unto me, saying: All who have died without a knowledge of this gospel, who would have received it if they had been permitted to tarry, shall be heirs of the celestial kingdom of God; Also all that shall die henceforth without a knowledge of it, who would have received it with all their hearts, shall be heirs of that kingdom; For I, the Lord, will judge all men according to their works, according to the desire of their hearts." D&C 137:1 & 5-9
This demonstrates that it is really by our works and the desires of our hearts that we will or will not enter in. As these excommunicated people can't repent and show remorse for undone deeds, they can never satisfy the demands of the church court system, to obtain re-baptism. Yet these people need not fear as they fit in the category of those unable to be baptized in this life.
We see an additional instance of people unable to be baptized who also enter into the Celestial Kingdom _
"And I also beheld that all children who die before they arrive at the years of accountability are saved in the celestial kingdom of heaven." D&C 137:10