Sayyiduna Wabisah bin Ma'bad (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) finished the prayer, and a man was praying alone behind the people, so he (peace and blessings be upon him) said: "O you who prays alone! Could you not have joined a row and entered along with them, or, if the space was too tight for you, pulled a man towards yourself? Repeat your prayer, for this prayer of yours has not counted."
Hadith Referenceالمعجم الكبير للطبراني / باب الواو / 18614