If you need to restrict access to Office365 for users outside your company at all or just for group of them then you need to use ADFS servers.
When you have set them properly and you can be authenticated by ADFS, then you can configure ADFS claims to restrict the Office 365 access.
First, I've tried use the solution provided in this link:
But, this not work in my environment.
I've been looking for article below, but can't find it as "limiting access".
Then when asked Microsoft they give me the right link.
Here is the right link: