If a person who is not sure of the existence of God dies, where does he go? If he has led a good life and not committed a mortal sin. I find it hard to believe that our loving God would condemn him to hell.
These links should answer your questions about the teaching of extra ecclesiam nulla salus, “outside the Church there is no salvation,” and how it relates to agnostics. The first one gives the Biblical explanation of what is necessary for salvation. If you have any further questions or concerns that are not answered by these links, please contact Catholic Answers directly.