Hi Haneen,
You can download the Community Commons Function Library from the appstore which has a "MonthsBetween" Java function which you can use for this expression. Put in 2 dates and it returns the difference in Months between de 2 dates.
https://appstore.home.mendix.com/link/app/170/
Kind Regards,
Corné