Question on Masters Degree required Duration

If I enroll for an Masters Degree from a nonprofit US College that will last for 18 Months, Can I apply for H1B Visa Under the Masters Cap? Should the duration of the Master Degree Course last for 24 Months?

I understand that the duration of the Masters Degree should not be less than 2 years. However, it is not mentioned that it should last for 4 Semesters. Kindly confirm.