Rule 1: 1. لَمَّا 'when'
لَمَّا introduces a completed event in the past and is followed by the perfect; the main clause that answers it is also in the perfect and needs no connecting word. Compare إِذَا from lesson 36, which looks forward to a future or repeated 'when'. لَمَّا looks back: when (once) the sun rose, ….
لَمَّا طَلَعَتِ الشَّمْسُ خَرَجَ الْجَدُّ مِنَ الْبَيْتِ.
lammā ṭalaʿati-sh-shamsu kharaja-l-jaddu mina-l-bayti
When the sun rose, the grandfather left the house.
طَلَعَتْ takes a kasra before the article: ṭalaʿati-sh-shamsu.
لَمَّا رَجَعَتِ الْبِنْتُ مِنَ الْمَدْرَسَةِ سَأَلَهَا أَبُوهَا.
lammā rajaʿati-l-bintu mina-l-madrasati saʾalahā abūhā
When the girl came back from school, her father asked her.
لَمَّا سَمِعَ الْمُسَافِرُونَ الْمُؤَذِّنَ دَخَلُوا الْمَسْجِدَ.
lammā samiʿa-l-musāfirūna-l-muʾadhdhina dakhalu-l-masjida
When the travellers heard the muezzin, they entered the mosque.