Sayyiduna Sahl bin Sa’d (may Allah be pleased with him) narrates that the people of Banu Amr bin Awf had a dispute among themselves. When the Prophet (peace and blessings of Allah be upon him) was informed of this, he led the Zuhr prayer and then went to them to reconcile between them. The Prophet (peace and blessings of Allah be upon him) said to Sayyiduna Bilal (may Allah be pleased with him): “O Bilal! When the time for Asr prayer comes and I have not returned, then request Abu Bakr to lead the people in prayer.” Then the complete hadith was narrated, and in the hadith it is also mentioned that the Prophet (peace and blessings of Allah be upon him) (during the prayer itself) arrived and stood behind Sayyiduna Abu Bakr (may Allah be pleased with him), and the Prophet (peace and blessings of Allah be upon him) signaled to him to continue his prayer.
And the appointing by the imam of a man from the congregation if he is absent from the presence of the mosque in which he leads the people, so the leadership of the prayer is by his command.
Hadith Referenceصحيح ابن خزيمه / كتاب الإمامة فى الصلاة وما فيها من السنن مختصر من كتاب المسند / 1517