Shaikh al-Albani rahimahullah wrote:
“As for older children, then their influence [from the signs and environment of Islam] is clear and self-evident. However, if it is found among them one who is playing in the Masaajid and running, then it is upon the fathers and guardians to order them, discipline them, and nurture them. Or for the administer or custodian [of the masjid] to kick them out. This action was mentioned by Hafidh ibn Kathir: If Umar ibn al-Khattab (may Allah be pleased with him) saw children playing in the masjid, he would hit them with his stick. He would look in the masjid after Isha and not leave anyone inside of it”.
Thamr al-Mustadaab pg. 762