Dave Meltzer previously reported that Mysterio was trying to get an 18-month contract but WWE wanted to lock him in for two years and that is what they got.
Mysterio was able to get a clause in his deal that would allow him to give notice after 18 months. As noted over the past several months, Mysterio has said publicly that he did not want to work a reduced schedule so he could allow his body enough time to heal and so he could spend more time with his family. Presumably, he will be at most WWE TV and pay-per-view events but he will likely work on less live events than he did during his previous run.
Mysterio is preparing to return and is waiting on WWE to work him back into storylines.