So such a journey does not fall under the prohibition.
The Prophet ﷺ then clarified in the ḥadith of ʿAmr ibn Shuʿayb that “One rider is a devil, two riders are two devils, and three make a caravan.” In other words, the person who travels alone is like a devil, the one who travels with only a single companion is two devils, whereas three travellers form a proper caravan; they are not devils but an independent company. This, too, is meant as a warning and a deterrent against solitary travel—and, by extension, against travelling as merely a pair—while travelling as three is unobjectionable. As I have already explained, this ruling applies only to journeys on which no one else is normally coming and going.
The author then cited the ḥadith of Abū Saʿīd and Abū Hurayrah in which the Messenger ﷺ instructed travellers, when they set out, to appoint one of them as leader; that is, they choose a single person to manage their affairs—saying, for example, “Let us go,” “Let us sit,” “Let us perform wuḍūʾ,” “Let us have dinner,” and the like. If they fail to appoint such a leader, their affairs become chaotic. Hence the saying, “People do not prosper when they are left in chaos with no leader over them.” There must be an amir (leader) who takes charge of their business.
The apparent sense of the ḥadith is that, once the travellers are content with him, obedience to that amir is obligatory in matters that concern the welfare of the journey, for he is the leader. In matters unrelated to the journey—each person’s private concerns—obedience to him is not obligatory. This, however, does not mean that the amir may act autocratically. Rather, he should be as Allah, exalted is He, says: “So pardon them, ask forgiveness for them, and consult them in the affair.” He must consult them about issues in which the best course of action is unclear and must not insist on his own opinion. As for matters that are self-evident, there is no need for consultation. Allah is the granter of success.