You can try with:
SELECT CAST(MONTHS_BETWEEN(date1, date2) AS INT) as numberOfMonthsBetweenDatesFROM table
This will return your expected result.