To answer this question, we need to explain the meaning of the word “Islam” first.
The word “Islam” in Arabic is a verbal noun of the root “Salama” which means “submission” or “total surrender.” In a religious context, it means “total surrender to the will of Allah (God).”
Allah (God) will only accept total surrender to His commands as a way of life.
Allah says in the Holy Qur’an [Surah Ala-Imran, verse 19]

Allah also says in the Qur’an (Surah Ala-Imran, verse 85)

In this context, God is referring to Islam as in the core belief, which He wants everyone to surrender to, totally.
This core belief is to believe that Allah is ONE and unique unlike anyone or anything else. He is the supreme being who created all things and created everyone existing in the past, present today, and everyone to come in the future. He has no partners, nor offspring.
Whoever totally surrenders to Allah in this way, then he or she is a Muslim.
All prophets and messengers of Allah before Muhammad (pbuh), had the same belief and taught it to their people. All prophets and messengers, including but not limited to Adam, Noah, Abraham, Ishmael, Isaac, David, Moses, Jesus and Muhammad (peace be upon them all) taught people to be Muslims. They delivered the message of Allah (God), that He is ONE and unique, created everyone and everything, with no partners and no offspring.
Therefore, all prophets and messengers before Muhammad (pbuh) were Muslims.
Here are some examples of how Allah relates the stories of other messengers before Muhammad.
#1
Allah mentions the story of Noah, when he was addressing his people in chapter Yunus, verse 72

#2
Allah mentions the story of Abraham and how he obeyed Allah in submission [Surah Al-Baqarah, verse 131]

#3
Abraham and Jacob advising their sons to only die as Muslims [Qur’an: Al-Baqarah, verse 132].

#4
Here Jacob is asking his sons what they will worship after he dies [Qur’an: Al-Baqarah, verse 133]

#5
Moses was a Muslim [Qur’an: Yunus, verse 84]

#6
Jesus was a Muslim [Qur’an: Ala-Imran, verse 52]

#7
Joseph was a Muslim [Qur’an: Yuusuf, verse 101]

In this sense, Islam was not something new the Muhammad (pbuh) started. It had begun from the time of Adam and will continue to the last day.
Therefore, Muhammad (peace be upon him) taught people the same message all other messengers taught of “total submission to Allah,” which is called “Islam” in Arabic.
Although Messengers of Allah before Muhammad (pbuh), and their followers were Muslims and believed the oneness of Allah, they differed in the rules and legislations that governed them. Rules and relegations had to be different to suit the time, custom, and environment they lived in. So, Allah (Glory be to Him) made rules that governed them to suit their time and customs. People were commanded to follow their messenger who was sent to them in their time until another messenger comes and then they were commanded to follow that messenger, and so on.
Prophet Muhammad (pbuh) is the last and final messenger from Allah, and no other messenger will come after him.
Allah said in the Qur’an [Al-Ahzab, verse 40]

Therefore, the message which was revealed to him is the most comprehensive, complete and final form for all humanity. It will be suitable and applicable for all time, anywhere, and for all humans. The detailed guidance within it (Qur’an and the tradition of the prophet being the main sources) covers all aspects of our lives and environments.
Allah said in the Quran [Alma’ida, verse 3]

May the peace and blessings of Allah be upon Muhammad, and all his brothers in Islam – the Messengers of Allah.