When the time of prayer comes, call the Adhan, then call the iqamah, then the one who is oldest of you should act as your imam. The version narrated by Maslamah goes : He said: On that day we were almost equal in knowledge. The version narrated by Isma’il says: Khalid said: I said to Abu Qilabah: where is the Qur’an(i.e. why did the Prophet ﷺ not say: The one who knows the Qur’an most should act as imam)? He replied: Both of them were equal in the knowledge of the Qur’an.
أَنَّ النَّبِيَّ ﷺ قَالَ لَهُ أَوْ لِصَاحِبٍ لَهُ إِذَا حَضَرَتِ الصَّلاَةُ فَأَذِّنَا ثُمَّ أَقِيمَا ثُمَّ لْيَؤُمَّكُمَا أَكْبَرُكُمَا وَفِي حَدِيثِ مَسْلَمَةَ قَالَ وَكُنَّا يَوْمَئِذٍ مُتَقَارِبَيْنِ فِي الْعِلْمِ وَقَالَ فِي حَدِيثِ إِسْمَاعِيلَ قَالَ خَالِدٌ قُلْتُ لأَبِي قِلاَبَةَ فَأَيْنَ الْقُرْآنُ قَالَ إِنَّهُمَا كَانَا مُتَقَارِبَيْنِ