We have two answers. One is 二 (èr), and the other is 两 (liǎng). Some times only one can be used, and some times both of them are OK.
Below is a general guideline on when to use 二 (èr), when to use “两 liǎng”, and when either will do.
Use 两 (liǎng) to express two of something or someone.
When to express two of something or someone, and only two of something or someone, such as two apples, two persons, two days, two years, use 两 (liǎng).
For example:
Two o’clock: 两点 (liǎng diǎn)
Two days: 两天 (liǎng tiān)
Two years: 两年 (liǎng nián)
Two years old: 两岁 (liǎng suì)
Two apples: 两个苹果 (liǎng gè píngguǒ)
Two cups of water: 两杯水 (liǎng bēi shuǐ)
Two people: 两个人 (liǎng gè rén)
If the number “2” is part of a larger number, such as 12, 22 or 102, use 二 (èr).
For example:
22: 二十二 (èr shí èr)
Use 二 (èr) in pure numerical expressions, or in a string of digits.
Such pure numerical expressions include telephone numbers and numbers after the decimal point,