Microsoft Office 2012 for Mac OS has not been supported on later releases of MacOS since MacOS 10.13 (High Sierra). So yes, if you wish to continue to use Microsoft Office, you will have to purchase Office365.
Here's where you can purchase it from Microsoft:
https://www.microsoft.com/en-us/microsoft-365/buy/microsoft-365
Note: You can buy a one-time perpetual license for one computer that is not a subscription price. It's at the bottom of the site page from the link above. Looks like it's $249 and you'd never have to pay again.
The subscription portion is cheaper up front, and it allows you to install it on up to five computers, including mobile devices.