Praise be to Allah.
The following questions were put to the Standing Committee for Academic Research and Issuing Fatwas (al-Lajnah al-Daa’imah li’l-Buhooth al-‘Ilmiyyah wa’l-Iftaa):
A person comes to the prayer and finds the rows full, and the last person in the row is a boy. Can he pull him back to pray beside him, or what?
If he comes and finds that the people are doing rukoo’, is it correct for him to pull someone back when he is in rukoo’, or what?
If the rows are full, and he cannot find anyone to pray with him except for young boys, some of whom have reached the age of discernment and some have not, is it OK for him to pray with them in that row?
The committee replied:
If he finds the row is full, he should wait until someone else comes to stand beside him, and should not pull anyone out of the row. If he can join the row or pray on the imaam’s right, he should do so. As for standing in the row with the boys, if they are of the age of discernment, then it is OK to join their row, because of the reports in al-Saheehayn and elsewhere from Anas (may Allah be pleased with him) who said:
“The orphan and I formed a row behind him, and the old lady stood behind us” – referring to their praying behind the Messenger of Allah (peace and blessings of Allah be upon him), when he visited him in his house one morning. If the boys are not yet of the age of discernment, then then praying with them behind the last row is like praying standing alone, and it is not correct to pray standing alone behind a row, because the Prophet (peace and blessings of Allah be upon him) said: “There is no prayer for the one who stands alone behind the row.”
And Allah is the source of strength. May Allah bless our Prophet Muhammad and his family and companions, and grant them peace.
Al-Lajnah al-Daa’imah li’l-Buhooth al-‘Ilmiyyah wa’l-Iftaa, Fataawa al-Lajnah al-Daa’imah, 8/706