When there are three persons, one of them should lead them. The one among them most worthy to act as Imam is one who is best versed in the Qur'an. (Using translation from Muslim 672a)
عَنِ النَّبِيِّ ﷺ قَالَ «إِذَا كَانُوا ثَلَاثَةً فَلْيَؤُمَّهُمْ أَحَدُهُمْ وَأَحَقُّهُمْ بِالْإِمَامَةِ أَقْرَؤُهُمْ»