Sayyiduna Ibn Abbas (may Allah be pleased with them both) narrates that the Prophet (peace and blessings be upon him) said: "Do not pray behind one who is sleeping or one who is talking."
This is the best of what has been narrated on this topic, and it is mursal. Hisham bin Ziyad Abu al-Miqdam also narrated it from Muhammad bin Ka'b, and he is matruk (abandoned).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3515
Hadith Gradingمحدثین:حسن
Hadith Takhrij«حسن۔ اخرجه ابوداود: 694۔ يه مرسل هي۔»