By default, you could share site with internal users. For sharing with external users, you should enable external sharing both in the tenant level and site level. Here're steps:
1.Enable external sharing in the tenant level. Go to SharePoint admin center -> Polices -> Sharing -> Set Anyone in the Content can be shared with section.
2.Enable external sharing in the tenant site level. Go to SharePoint admin center -> Sites -> Active sites -> Select the site -> Sharing -> Set Anyone in the External shaing.
3.Go to Site permissions -> Add members -> Share site only.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.