From a linguistic perspective, the word Islam means submission, referring to the submission to God. Therefore, a Muslim is one who submits their will to God. Therefore, Muslims believe that all the Prophets and Messengers (Peace and Blessings be them all), and also the righteous people that lived and died were Muslims because they submitted their will to God and believed in Him. Even though they all died before The Quran was even revealed, Muslims believe that they were all still Muslims. This shows how just Allah is, because many people lived and died before The Quran was revealed, but that doesn’t mean that they will go to Hell. Rather, Allah sent down many scriptures (Torah, Gospel, Psalms, etc.) and Messengers to call people to The Truth, and if one didn’t hear The True Message, or a fake message that isn’t what Islam actually teaches (terrorism, killing innocents, etc) then Allah Says in The Noble Quran (interpretation of meaning), “And We would never punish ˹a people˺ until We have sent a messenger ˹to warn them˺” (Quran 17:15).
And Allah Knows best.