The scope of customer accounts can be limited to the website where the account was created, or shared with all websites and stores in the store hierarchy.
Set the scope of customer accounts
On the Admin sidebar, go to Stores > Settings > Configuration.
In the left panel, expand Customers and choose Customer Configuration.
Expand the Account Sharing Options section.
Set Share Customer Accounts to one of the following:
Global Shares customer account information with every website and store in the Magento installation. Per Website Limits customer account information to the website where the account was created.
If necessary, clear the User system value checkbox to make the change.
When complete, click Save Config.
If the website is excluded from the customer group, the customer is not allowed to log in to the website when the scope of customer accounts is limited to the website or shared with all websites.