Sahl bin Hunayf and Qays bin Saad were sitting in Qadisiyyah when a funeral procession passed by them, so they stood up. Someone said to them, "It is from the people of the land," meaning from the protected non-Muslim residents.They replied, "A funeral procession once passed by the Prophet ﷺ and he stood up. He was told, 'It is the funeral of a Jew.' He said, 'Is it not a soul?'"
كان سهل بن حنيف وقيس ابن سعد قاعدين بالقادسية، فمروا عليهما بجنازة فقاما، فقيل لهما: إنها من أهل الأرض- أي من أهل الذمة- فقالا: إن النبي ﷺ مرت به جنازة فقام، فقيل له: إنها جنازة يهودي، فقال: أليست نفسا؟
Bukhari narrated it in the Book of Funerals (1312), and Muslim in the Book of Funerals (961), both of them through Shuba, from Amr bin Mura, from Ibn Abu Layla, who related it. The wording given is Bukhari's, and Muslim's wording is close to it, but it does not contain the explanation of his statement, "It is from the people of the earth."