Microsoft have released a tool to diagnose and fix issues with Outlook and Office 365.
It is updated regularly, and should be the first step when you experience issue in connecting to Office 365.
The tool is available here – https://diagnostics.outlook.com