To avoid confusing the rules of mim and nun, compare pairs while first identifying the unvowelled original letter and only then the next consonant.
«هُمْ بِهِ» — still mim + ba: ikhfa shafawi.
«مِنْ بَعْدِ» — still nun + ba: iqlab.
«لَكُمْ مَا» — still mim + mim: idgham shafawi.
«مِنْ مَالٍ» — still nun + mim: idgham with ghunnah.
«أَنْعَمْتَ» — nun + ayn takes throat clarity, while mim + ta takes labial clarity in the same word.
The final example is especially useful: two different unvowelled consonants in one word may trigger two separate rules. A single broad label for the whole word is insufficient.