You can set Allow Guest Checkout to No in Stores > Configuration > Sales > Checkout > Checkout Options