Comparing "er" and "liang"
Structure
In Chinese, there are two words for two.
The digit 2 is 二. This is used generally in numbers, when counting to ten and so on. When specifying quantities, however, 两 is used. This is when you want to say two of something.
A good rule is that if a measure word is used, use 两. 二 does not generally occur with measure words.
Also remember that two o'clock uses 两: 两点. It's two points on the clock, which is a quantity, so 两 must be used.