This article explains how to factory reset Samsung Galaxy S7, S7 Edge, and S7 Active.
How to Hard Reset Samsung Galaxy S7 Smartphone
The easiest way to factory reset your device is through the Settings menu.
Go to Settings > General management > Reset > Factory data reset.
In older software versions (not updated), you need to go to Settings > Backup & reset > Factory data reset > Reset device.