Your store can be configured to require shoppers to open an account before making a purchase. The default setting allows guests to make purchases, with an option to register for an account after they complete the checkout process.
To disable guest checkout:
On the Admin sidebar, go to Stores > Settings > Configuration.
On the left panel, expand Sales and choose Checkout.
Expand the Checkout Options section.
For a detailed description of each of these configuration settings, see Checkout Options in the Configuration Reference Guide.
If the setting is for a specific store view, choose the store view where the configuration applies.
When prompted, click OK to continue.
Set Allow Guest Checkout to
If necessary, clear the Use system value checkbox to enable changes to this setting.
Click Save Config.