[Surah Al-Qalam 68:4]
Today most of the Non-Muslims know that Mohammed ﷺ is the Prophet of Allah. There are books and articles written that acknowledge him as the most successful leader, human rights champion, a perfect humanbeing with the best Akhlaq (character) and transformative teachings.
Gandhi knew about the Prophet, but he did not accept the Prophethood of Mohammed ﷺ
After the second world war, India got independence from the British rule and Congress party won the election with significant majority. By then, Gandhiji had disassociated himself from his party and started playing the role of a guardian for the country. He wrote an article which was widely circulated in the country. His advice for the new government was, “I can not help it but to present to you the names of Abu Bakar and Umar Farooq . They were leaders of a vast Empire, yet they lived a life of prudence.” (Harijan, 27/July 1937 Edition). In the above statement, Gandhiji was referring to the character of the two of the finest companions of the Prophet ﷺ, who were his ardent students, too. Gandhiji knew about the Prophet ﷺ, his qualities and Akhlaq, but he did not accept the Prophethood of Mohammed ﷺ.
Even the learned men from the Jewish community knew him
Safiyya bint Huyyay was the daughter of a Jewish leader. Later, she married the Prophet ﷺ. She narrates, “ When the Prophet ﷺ migrated to Madina, I was a young girl. One day, I heard my father and his younger brother talk about it. Since my father was a learned man so he decided to go and verify himself if the man was a true Prophet. I waited for them in the evening after sunset and I saw them coming. I overheard my paternal uncle asking my father, “Is he the same Prophet mentioned in our books?” My father replied, “Yes, certainly”. My uncle asked, “Should we not believe in him?” He replied, “We will not, because we had believed that he would be born in our tribe”.
They had the knowledge but did not accept his prophethood and the Qur’an also mentioned their deceitfulness,
“Those to whom We gave the Scripture know him as they know their own sons. But indeed, a party of them conceal the truth while they know”Surah al baqarah verse 146