There is no contradiction between the hadith in As-Sahihayn in which the Prophet (blessings and peace of Allah be upon him) said: “No one will enter Paradise except a Muslim soul” [narrated by al-Bukhari, 2897; and Muslim, 178],
and what Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said, that adults who lived during the interval between prophets may enter Paradise after being tested. That is because, after being tested, some of them will pass the test and thus become Muslim, submitting to Allah, so they will enter paradise. Thus the hadith which says “No one will enter Paradise except a Muslim soul” includes them, because they will not enter it until after they become Muslim.
The statement of Shaykh al-Islam [Ibn Taymiyah] clearly indicates that what is meant is that those of the people who lived during the interval between prophets who will enter Paradise are those who will obey and thus pass the test: “whoever obeys at that time will enter Paradise, and whoever disobeys will enter Hell.”
He stated this more clearly in his book Ar-Radd `ala ash-Shadhili, 1/131, where he said: The general guideline concerning this issue is that no one will enter Paradise except a believer, and every believer will inevitably enter Paradise, and every disbeliever will inevitably enter Hell. So whoever believed in the messengers will inevitably enter Paradise, and whoever disbelieved in the messengers will inevitably be punished.
Whoever neither believed nor disbelieved in them because the message never reached him will not be among either group. Rather Allah knows best about him, and in the report it says that messengers will be sent to these people in the hereafter, after which those who believe will enjoy bliss and those who disbelieve will be punished.
We have previously given a detailed answer on our website about the issue of those who lived during the interval between prophets being tested [in the hereafter]. Please see the answer to question no. 98714.
And Allah knows best.