It is narrated from Sayyiduna Abu Talhah (may Allah be pleased with him); he said: We were sitting in the open spaces in front of the houses when the Prophet (peace and blessings be upon him) passed by us and said: "What business do you have sitting on the roads?" We said: "O Messenger of Allah, we sat down to talk and to remember Allah." He (peace and blessings be upon him) said: "Then give the gatherings their due." We said: "O Messenger of Allah, and what is their due?" He (peace and blessings be upon him) said: "Lowering the gaze, returning the greeting of peace, guiding the way, and speaking good words."
Hadith Referenceالمعجم الكبير للطبراني / باب الزاي / 4708