حَدَّثَنَا زُهَيْرٌ ، حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ ، أَخْبَرَنَا حُمَيْدٌ ، عَنْ أَنَسٍ ، أَنَّ النَّبِيَّ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ كَانَ يُحِبُّ أَنْ يَلِيَهُ الْمُهَاجِرُونَ وَالْأَنْصَارُ فِي الصَّلَاةِ لِيَأْخُذُوا عَنْهُ .
It is narrated from Sayyiduna Anas (may Allah be pleased with him): "The Messenger of Allah (peace and blessings be upon him) used to like that the Muhajirun and the Ansar (may Allah be pleased with them) should be right next to him in the prayer (in the first row), so that they could learn (the actions and rulings of the prayer) from him (peace and blessings be upon him)."
Related hadith on this topic