Rule 1: When qalqala occurs
Qalqala happens whenever one of the five letters has sukūn, whether that sukūn is written in the word or arises because you stop on the word. It never happens when the letter carries a vowel: in تَبَّتْ the doubled ب is followed by fatḥa, so there is no bounce. The sukūn may be in the middle of a word (يَدْخُلُونَ) or at the end of a word that you continue through (قَدْ أَفْلَحَ).
يَدْخُلُونَ
yadkhulūna
they enter
دْ in the middle of the word (110:2).
اقْرَأْ
iqraʾ
read!
قْ with sukūn written in the word (96:1).
أَلَمْ يَجْعَلْ
alam yajʿal
did He not make
جْ with sukūn written in the word (105:2).
مَطْلَعِ الْفَجْرِ
maṭlaʿi l-fajri
the rising of the dawn
طْ heavy with a heavy bounce (97:5).
اَلْأَبْتَرُ
al-abtaru
the one cut off
بْ in the middle of the word (108:3).