The author - may Allah shower blessings on him - said in what he cited from Aboo Sa'eed Al-Khudree - may Allah be pleased with him -, that the Prophet (ﷺ) said, "Beware of sitting on roads." This is an expression of warning; that is to say, "I warn you not to sit on the ways." And that is owing to the fact that sitting on roads (often) leads to noticing faults; those going and returning, looking at the belongings they are carrying that may be confidential. They may not be pleased that others see them.
It may also lead to backbiting and slandering the pedestrians; they begin to badmouth the honour of passers-by.
The point here is that, sitting by the roadsides leads to evils. However, when he - ﷺ - said, "Beware of sitting on roads", warning them against that, they enquired, "O Messenger of Allah! We have not but those as our places of sitting." That is to say, we sit down there to talk, familiarize with one another which is beneficial.
So, when the Prophet (ﷺ) noticed that they were hell-bent on that sitting, he said, "If you must sit then fulfill rights of the way." He - ﷺ - wasn't stringent with them neither did he prevent them from these sittings where they converse and get along with one another. He - peace and blessings be upon him - did not come down hard on them regarding this. It was from his attributes to deal kindly and compassionately with the believers.
He said, "If you must sit" i.e., to sit, "then fulfill the rights of the way." They asked, "What are its rights, O Messenger of Allah?" He explained, "Lowering the gaze, removing harmful (things), responding to the greeting of Salaam, enjoining and forbidding evil."
Five things:
First, lowering the gaze: That you lower your gazes from passers-by; whether male or female since it is compulsory for a man to drop his gaze from a woman and vice versa. Do not fix your gaze at him until you see what is with him. In the past, a man would return home with daily articles, carrying them in his hand. Then when he passes by these people, they would look at him and say, "What does he have with him?" and similar other expressions. Even, until recently, when a man passes by with mutton for his family, they would begin to discuss him, "So-and-so came returned home with some mutton
for his family today” and so on. Hence, the Prophet (ﷺ) ordered his companions to lower their gaze.
Second, removing harmful object: that is, holding back harm; whether through speech or deed. As for harm through speech, it is that they discuss or backbite the passer-by and then slander him!
Harm through deed could be through constricting him on the path; occupying the roads, harming the passers-by. Passing through the road would be impossible except after exhaustion and hardship.
Third, returning greetings: Whenever a person gives the salaam, you must respond to him. This is one of the rights of the road because it is recommended that the passer-by greets those seated. As such, when the pedestrian greets the sitting people, they must answer such greetings.
Fourth, enjoining good: Al-Ma'roof (as it occurs in the Arabic text, meaning, good) refers to all that Allah and His Messenger – ﷺ - enjoined; you must enjoin them as well. If you find anyone falling short, whether among the passers-by or others, you should enjoin him to do good, adjure and encourage him towards righteousness.
Fifth, forbidding evil: If you notice anyone passing by committing any evil, like smoking cigarette, or similar other evils, he should caution him. These are the rights of the way.
In this Hadeeth, the Prophet (ﷺ) warned the Muslims against sitting on the roads. However, if that becomes necessary, then it is obligatory to fulfill the rights of the way.
The rights of the road are five as explained by the Prophet (ﷺ): lowering the gaze, keeping away harm, returning the greetings of Salaam, enjoining good and forbidding evil. These are the rights of road for whosoever that sits there as explained by the Prophet (ﷺ).
And Allah alone grants success.