It is narrated from Sayyiduna Abu Dharr (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said (to me): "O Abu Dharr! Raise your gaze and look at the man who appears to you to be the most honoured and highest in rank in the mosque (and point him out)." Sayyiduna Abu Dharr (may Allah be pleased with him) narrates: I looked around and saw a man sitting wearing a (very fine) robe, and I said: "This man." Then he (peace and blessings be upon him) said: "O Abu Dharr! Now raise your gaze and look at the man who appears to you to be the most insignificant and wretched in the mosque." He narrates: I looked and saw an extremely weak and frail man wearing worn-out clothes, and I said: "(O Messenger of Allah!) This man." Then he (peace and blessings be upon him) said: "By the One in whose Hand is my soul! This (wretched-looking) man is better and more excellent in the sight of Allah on the Day of Resurrection than an earth-full of people like that (man in fine clothes)."
Imam Abu Bakr bin Abi Shaybah recorded this hadith, and the wording is his. Imam Ahmad bin Hanbal, al-Harith bin Abi Usamah and Abu Ya'la al-Mawsili also recorded it, and from him Imam Ibn Hibban recorded it in his Sahih.