This is called FRP - Factory Reset Protection. The Gmail account used on the phone before the factory reset must be the same one that logs in after the reset. This is a theft-prevention feature that prevents a thief from stealing someone's phone, resetting it and using it as their own. If you have forgotten your Google password, you can log into Google on a PC, reset your password and then set up your Galaxy S7.