My first guess is that your MS 365 License is not correctly attached to your Microsoft Account. Open your Services page and verify that the MS 365 subscription is there.
https://account.microsoft.com/services
If the subscription is there, then use the Troubleshooters
Troubleshoot installing Office - Microsoft Support
Unlicensed Product and activation errors in Office - Microsoft Support