The posting below appears to describe your issue. See if this helps:
MS Office 365 authentication: error code 0x0
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_install-mso_mac-mso_o365b/ms-office-365-authentication-error-code-0x0/0f224b46-f8f0-4ca8-a7d0-04d9068501f9