God is not bound by the rules that He makes for us to obey. Some people obey God's laws even though, through no fault of their own, they do not know Him. God will most likely have mercy on them and save them.
Romans 2:14-16
14 When
Gentiles who have not the law do by nature what the law requires, they are a law to themselves, even though they do not have the law. 15
They show that what the law requires is written on their hearts, while their conscience also bears witness and their conflicting thoughts accuse or perhaps excuse them 16 on that day when, according to my gospel, God judges the secrets of men by Christ Jesus. rsv
Romans 9:15
For he says to Moses, “I will have mercy on whom I have mercy, and I will have compassion on whom I have compassion.” rsv
God saved the pagan Rahab and her whole family because she did good.
Joshua 6:25
But
Rahab the harlot, and her father’s household, and all who belonged to her, Joshua saved alive; and she dwelt in Israel to this day, because she hid the messengers whom Joshua sent to spy out Jericho. rsv
1 Corinthians 4:5
Therefore
do not pronounce judgment before the time, before
the Lord comes, who will bring to light the things now hidden in darkness
and will disclose the purposes of the heart.
Then every man will receive his commendation from God. rsv
2 Corinthians 5:10
For we must all appear before the judgment seat of Christ, so that each one may receive
good or evil, according to what he has done in the body. rsv
John 5:28-29
Do not marvel at this; for the hour is coming when
all who are in the tombs will hear his voice 29 and come forth,
those who have done good, to the resurrection of life, and
those who have done evil, to the resurrection of judgment.
As for Romans 2: the high lighted is impotant part of context:
"[But after thy hardness and impenitent heart treasurest up unto thyself wrath against the day of wrath and revelation of the righteous judgment of God;
6 Who will render to every man according to his deeds:
7
To them who by patient continuance in well doing seek for glory and honour and immortality, eternal life:
8 But unto them that are contentious, and
do not obey the truth, but obey unrighteousness, indignation and wrath,
9 Tribulation and anguish, upon every soul of man that doeth evil, of the Jew first, and also of the Gentile;
10 But glory, honour, and peace, to every man that worketh good, to the Jew first, and also to the Gentile:
11 For there is no respect of persons with God.
12 For as many as have sinned without law shall also perish without law: and as many as have sinned in the law shall be judged by the law;
13 (For not the hearers of the law are just before God, but
the doers of the law shall be justified.
14 For when the Gentiles, which have not the law, do by nature the things contained in the law, these, having not the law, are a law unto themselves:
15 Which shew the work of the law written in their hearts, their conscience also bearing witness, and their thoughts the mean while accusing or else excusing one another
16
In the day when God shall judge the secrets of men by Jesus Christ according to my gospel.
17 Behold, thou art called a Jew, and restest in the law, and makest thy boast of God,
18 And knowest his will, and approvest the things that are more excellent, being instructed out of the law;]"
Remember what the scripture states eternal life is?