Access needs to be given to an external user into a document library which is in a sub site. But the user should not be able to view the content of the main site that means the external user should not have access to the main site in SharePoint 2013 What type of access structure can be done on this?
maybe this could help!
goto this part:
Share a document requiring sign in to your site
You must be a Site Owner or have full control permissions to share a document with external users. Additionally, the external sharing feature must be turned on in either the Office 365 Service Settings or the SharePoint Online admin center (depending on which plan you have). External sharing must also be turned on for your site collection (enterprise plans only).