Open up your Admin page for Office 365 and click on Manage under Lync.
Select Domain Federation from the top menu.
By default you will see that domain federation is disabled. Click on Edit.
You will be given 3 options.
The first is if you want open federation and allow any of your members of staff to connect with another other Lync. The second is to allow you as the administrator which other lync federation domains you want to allow staff to connect to. The third disables federation.
Is this for the Enterprise Office 365 package? For Small Business (Plan 1), it looks like this is called “External Communication” and there is only an Enable/Disable button. Enabled by default.