Rule 1: 1. Thousands and millions in construct
أَلْفٌ a thousand (plural آلَافٌ) and مِلْيُونٌ a million (plural مَلَايِينُ) are ordinary masculine nouns, so they are themselves counted like any noun: ثَلَاثَةُ آلَافٍ three thousand (3–10 take the genitive plural, and the number has ة because أَلْف is masculine), خَمْسَةَ عَشَرَ أَلْفًا fifteen thousand, ثَلَاثُونَ أَلْفًا thirty thousand (11–99 take the accusative singular), مِائَةُ أَلْفٍ a hundred thousand. When the thing counted follows, أَلْف stands in construct with it and the thing counted is a genitive singular: أَلْفُ مَسْكَنٍ, ثَلَاثَةُ آلَافِ مَسْكَنٍ, ثَلَاثُونَ أَلْفَ مَسْكَنٍ. In construct the tanwīn of أَلْفًا naturally disappears: ثَلَاثُونَ أَلْفًا but ثَلَاثُونَ أَلْفَ مَسْكَنٍ. In print the figure is usually written in numerals, ٣٠ أَلْفَ مَسْكَنٍ, and read aloud in full.
أَلْفُ مَسْكَنٍ
alfu maskanin
a thousand dwellings
أَلْف in construct; the counted noun is a genitive singular.
أَلْفَا عَامِلٍ
alfā ʿāmilin
two thousand workers
Dual of أَلْف in construct: the ن of أَلْفَانِ falls away.
خَمْسَةُ آلَافِ طَالِبٍ
khamsatu ālāfi ṭālibin
five thousand students
3–10: آلَاف genitive plural, then the counted noun.
سَبْعَةَ عَشَرَ أَلْفَ مَسْكَنٍ
sabʿata ʿashara alfa maskanin
seventeen thousand dwellings
11–99: أَلْفَ accusative singular, without tanwīn because it is in construct.
مِائَةُ أَلْفِ نَسَمَةٍ
miʾatu alfi nasamatin
a hundred thousand inhabitants
نِصْفُ مِلْيُونِ مُصْطَافٍ
niṣfu milyūni muṣṭāfin
half a million holidaymakers
مِلْيُون behaves exactly like أَلْف.