When you create a team, your SharePoint site collection will be provisioned under “sites” managed path by default.
How to create those site collections under “teams” path. It is easy.
Navigate to SharePoint Admin Center in Office365
Navigate to Settings
Do the adjustment under Site Creation section