When the people of Mecca had tried to hurt him and kill him.
What made the People of Madina Love and Accept the Prophet before they’d even met him?
Jews and Christians of Madeena were Non-Arabs and more dominent over two Arab tribes Aos and Khazraj.
Jews and Christians always use to discuss about the expected comming of last Prophet as per signs mentioned in their holy books. Christians claim that last Prophet would be from Christians and Jews calim He would be from Jews, and always be proud to discuss this matter in front of innocent Arabs who were sattled in Madeena from Yamen.
Arabs in Madeena were always feeling ignored when they could not take part in the discussion about comming of the last Prophet. When they listen about an Arab in Makkah with the same signs, jews and Christians always used to discuss, they were very happy to hear about it that last Prophet is an Arab, so they send a group of people from them to get info. That group from Madeena visited Muhammad pbuh and become Muslim, also they invited Muhammad pbuh in Madeena.
Muhammad pbuh was almost last along with Abu-Bakr Siddique (r.a.h.t.a) to migrate to Madeena, where most of the compegnions of Muhammad pbuh including Umer bin Khattab (r.a.t.a) with hia all Muslim family members had already migrated to Madeena before Muhammad pbuh. They had built a Mosque there and they received a message from Muhammad pbuh, to start Juma’a prayer, first time in Madeena.
So all members of Aos and Khazraj tribes except few young men, were converted to Islam in Madeena and they were aunxiously waiting for Muhammad pbuh in Madeena, under the management of Umer bin Khattab, may Allah be pleased on them all.