is there a way to hide a "custom field" in edit mode Drupal 8? I have a form with 5 custom fields. I would like to hide a couple of fields based on the view mode in the back-end while the user is editing the form.  Right now you can easily hide the field in the front end, but i am looking for way to not confuse the editors and hide the form fields while they are making changes.
Disable fields still show up in the back-end. 

My goal is simple: if your view mode has the field disable it should not show up in the back-end and in the front end.

is there a setting or a hook that can allow me to accomplish that.
Making this based if it's printed on a view mode, makes things quite complex. You'll have to write a custom module.

Try using the Fields Permissions which is based on Roles. So just check mark the Roles that should be able to see the field in the front.