Sunan Abi Dawud Book 2, Hadith 156
This tradition has been transmitted through a different chain of narrators in a similar way by ‘Ali b. Abi Talib.
when the Iqamah was pronounced and the Messenger of Allah (ﷺ) saw that they (the people) were small in number, he would sit down, nd would not pray; but when he saw them (the people) large in number, he would pray.
I heard the Messenger of Allah (ﷺ) say: If there are three men in a village or in the desert among whom prayer is not offered (in congregation), the devil has got the mastery over them. So observe (prayer) in congregation), for the wolf eats only the straggling animal. Sa'ib said: By the word Jama'ah he meant saying prayer in company or in congregation.