There is in Android the possibility to activate so-called developer options, in which the option "USB Debugging" is integrated. USB debugging can be helpful, for example, if you have problems with the USB connection to your computer.
However, maybe USB debugging cannot be activated, even though the developer options are enabled. The entry is grayed out and the controller cannot be set to "active". The solution is usually very simple and is as follows:
Check if "MyKnox" is installed on your Samsung Galaxy S7. If this app is installed on the Samsung Galaxy S7, the "USB Debugging" option will be disabled and cannot be activated. So open the app menu and find the app "My Knox".
If you do not use it actively, then uninstall it, in order to activate USB debugging in the developer options. You now know why USB debugging is grayed out on your Samsung Galaxy S7 in the developer options.