How do we know the Lam rule?
Look at the vowel before the Divine Name in connected reading; it is the key to the rule. We do not rely on the shape of the Lam alone.
The Lam of the Divine Name is heavy after a fathah or dammah, as in: قَالَ اللَّهُ، رَسُولُ اللَّهِ.
قَالَ ٱللَّهُ · رَسُولُ ٱللَّهِIt is light after a kasrah, as in: بِسْمِ اللَّهِ، لِلَّهِ.
بِسۡمِ ٱللَّهِ · لِلَّهِWhen we start reading with the name of Allah, we begin with a connecting hamzah carrying a fathah, so the Lam is heavy.
ٱللَّهُCareful in connected reading: The rule follows the vowel actually pronounced before the Divine Name in connected reading, not the shape of the previous word: a long vowel carries its own vowel (عَلَى ٱللَّهِ after a fathah → heavy, وَٱتَّقُواْ ٱللَّهَ after a dammah → heavy, فِي ٱللَّهِ after a kasrah → light), and the connecting hamzah is not pronounced.