二 vs 两
èr vs liǎng
Comparing "er" and "liang"
两 counts two of something; 二 is the digit two.
两 + Measure Word · 二 in counting and larger numbers
How it works
两个人 (two people), 两杯水 (two glasses) — before a measure word, always 两. 二十二, 第二, 二楼 — counting, ordinals and digits use 二.
Time follows the rule: 两点 for 2 o'clock, but 二月 for February, because 二月 is the second month rather than two months.
For large units both appear: 两百 and 二百 are both said, with 两千 and 两万 being the norm.
Examples
liǎng gè rén
两个人。
Two people.
èr shí èr
二十二
twenty-two
xiàn zài liǎng diǎn, èr yuè èr hào
现在两点,二月二号。
It's two o'clock, the second of February.