Bible says this, about people who have not heard of Jesus:
For as many as have sinned without law will also perish without the law. As many as have sinned under the law will be judged by the law. For it isn't the hearers of the law who are righteous before God, but the doers of the law will be justified (for when Gentiles who don't have the law do by nature the things of the law, these, not having the law, are a law to themselves, in that they show the work of the law written in their hearts, their conscience testifying with them, and their thoughts among themselves accusing or else excusing them) in the day when God will judge the secrets of men, according to my gospel, by Jesus Christ.
Romans 2:12-16
Those who have not heard of Jesus may have righteous mind and as Jesus says, eternal life is for righteous.
These will go away into eternal punishment, but the righteous into eternal life.
Matt. 25:46