Magento 2 Stop Sharing Customer Account Between 2 Websites

By default, Magento share a customer account between multiple websites in Magento 2, you can disable this from the Magento Admin > STORES > Configuration > CUSTOMERS > Customer Configuration > account Sharing Options from here select select “Global” from the “Share Customer Accounts” dropdown.

Magento 2 Share Customer Account
Share Customer Accounts – Magento 2 Admin

This will help when you are running 2 types of different websites from the same Magento admin or when you are running B2B and B2C websites from the same Magento installation and you do not want to allow B2C customers to login in to B2B website.