A 2012 MacBook Air can be ugraded as far as macOS Catalina 10.15.7 and it was shipped with Mac OS X Lion 10.7.4
I have updated a 2015 MacBook Air to Monterey and it is working very nicely, so Catalina should also work for you. However, some of the experienced hardware specialists here recommend incremental upgrades to Catalina, and some would suggest you go only as far as the previous system MacOS 10.14.6 Mojave.
You can get older versions of macOS from: How to get old versions of macOS
In any case, and as Apple notes in the linked page, you would have to upgrade from Lion to Sierra and from Sierra to Mojave or Catalina. Be aware that the latter is a 64 bit system and you will lose access to 32 bit software.
If you wanted to install Microsoft Office you would need to have Catalina. The system requirements for the Office suite are the current one and the previous two, which is to say macOS 12, macOS 11 and macOS 10.15. You will have to achieve this before the release of the next macOS because the minimum system would then be macOS 11 Big Sur. This also applies to updates of Office. Once Catalina is no longer supported an Office installation cannot up updated.
But before you can do anything you will need to make sure your inherited Mac has been signed out of iCloud by the previous owner. Activation Lock will prevent you signing out of that account and you cannot sign into your own iCloud account.