Whenever you plan a factory reset in preparation to give the phone to someone else, it's always a good idea to first remove your Google account (and Samsung account) from the phone in Settings>Accounts. If you do a factory reset without removing your Google account, on most phones that triggers Factory Reset Protection, which prompts the user to enter the previously associated Google account/password upon attempted startup.
If you did a factory reset without removing your Google account, try starting it up again and see if it prompts you for your Google account/password first (or early in the process). If it does, then log back in, and if you find that it boots back up to your usual setup, then remove your account from the phone as described above, and then do the factory reset again.