Used for two distinct types, methods, or a set of two things. Often appears in phrases like 二通りに分ける or 二通りの意味.
There are two ways to solve this problem.
書類を二通りに分けて保管してください。
Please divide the documents into two groups and store them.
二つ is the general counter for two items, while 二通り emphasizes two distinct types, methods, or categories.
二種類 also means 'two kinds' but is more concrete and often used for physical objects or species; 二通り can be more abstract (ways, methods).
Compound of 二 (ふた, 'two') and 通り (とおり, 'way, kind'). The reading ふた is an older native Japanese numeral form.