When one comes to    the mosque and finds the last row full
Question

What should a person who comes to the Prayer late and finds that there is no space in the rows do?; does he pray by himself due to the weakness of the hadeeth which demands that the person pulls a person from the row? What about a person from the filled row backing up himself for the person who is praying alone in the back?
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
If it is feared that he will miss the prayer and there is no place in the row, and no one else comes along to pray behind the imaam, then his prayer standing alone is valid, because Allâh says (interpretation of the meaning):
“So keep your duty to Allah and fear Him as much as you can” [al-Taghaabun 64:16]. This was the fatwa of Shaykh al-Islam Ibn Taymiyah, may Allah have mercy on him.
And Allah knows best.