All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
We have previously clarified the interpretation of Quran 7:172 in Fatwa 227149 and highlighted that its intended meaning is that Allaah The Exalted has endowed humans with the Fitrah (natural disposition) of Tawheed (assertion of monotheism), i.e. to worship Him alone, and that Allaah made them witnesses to that while they were still in the loins of their fathers.
However, as the Prophet, sallallaahu ‘alayhi wa sallam, said: "… and there is none to whom excuses are more loved than Allaah, and it is because of this that He has revealed the Book and sent the Messengers." [Al-Bukhari and Muslim; this is the wording in Muslim]
This Hadeeth indicates that Allaah The Exalted does not punish anyone based solely on that Fitrah of Tawheed instilled into human nature until He sends a Messenger to him, as in the verse which you referred to in your question: {And never would We punish until We sent a messenger.} [Quran 17:15]
Shaykhul-Islam Ibn Taymiyyah said, "I have always been among the most stringent people in prohibiting that a specific person be accused of disbelief, dissoluteness or sinfulness until the proof has been established to him (beyond the excuse of ignorance) by a Messenger of Allaah, such that the one contravening it is, in some instances, a disbeliever, in others, a person of bad moral character and in others, a sinner. And I affirm that Allaah excuses this Community of its mistakes, whether it be in matters of beliefs or actions."
He reiterated elsewhere: "Textual evidence in the Quran and Sunnah indicates that Allaah does not punish anyone until the message of Truth reaches him, as brought to him by a Messenger from Allaah. Those who have not received the message of Truth or received a distorted or incomplete version of the message will not be punished except for what they have denied of what has reached them through the Messenger of Allaah. This is affirmed in the verse that reads (what means): {[We sent] messengers as bringers of good tidings and warners so that mankind will have no argument against Allaah after the messengers....} [Quran 4:165]"
As for those who have not received the message of Islam in the first place, we have underlined the relevant judgment in Fataawa 82190 and 3191. The fact that these people will be tested on the Day of Judgment with a special test indicates that Allaah does not punish anyone merely based on the Fitrah which He endowed him with except after sending him a messenger to teach him beyond the excuse of ignorance. This is a manifestation of His perfect justice, kindness and mercy.
We would like to point out something very important; you should beware of obsessive devilish whisperings affecting your faith. You are advised to settle for what you know already, and whenever faced with any further confusion regarding any matter, you should entrust Allaah with the knowledge concerning it; Allaah says (what means): {And no one knows its [true] interpretation except Allaah. But those firm in knowledge say, "We believe in it. All [of it] is from our Lord." And no one will be reminded except those of understanding.} [Quran 3:7] You should know that such devilish whisperings do not undermine one's faith as long as the person strives to repel them and they do not dwell in his heart. Abu Hurayrah reported that a group of the Companions went to the Prophet, sallallaahu ‘alayhi wa sallam, asking: "Verily we perceive in our minds that which every one of us considers too grave to speak of." He, sallallaahu ‘alayhi wa sallam, said: "Is that how you really feel?" They said: "Yes." Upon this he, sallallaahu ‘alayhi wa sallam, said: "That is genuine faith." [Muslim]
Allaah Knows best.