From memory (therefore open to correction) the Prophet lived in Makkah for 50 years. At the age of 40 he was bestowed with the Office of Nubuwwat and he preached in Makkah for 10 years. Following this he moved to Madinah and lived there for 13 years after which he passed away. As far as I know other than his travels due to Ghazawaat, Hajj and Umrah to different places where he encamped he always returned back to Madinah. He had made Madinah his home. After the conquest of Makkah the Ansar were extremely despondent thinking that Rasulullah would now remain at his birthplace. However, he assuaged them and reassured them that his home was in Madinah. Hope the above helps.