Keyboard Shortcuts For Superscript in Word is CTRL + Shift + +
Keyboard Shortcuts For Subscript in Word is CTRL + =
We can use the the Ribbon Buttons to add Subscripts and Superscripts and it can found in Home Tab and Font formatting:

We can use dialog box to add Subscripts and Superscript in Word using key combination of CTRL + D.
Keyboard Shortcuts for Google Docs
Keyboard Shortcuts For Superscript in Google Docs CTRL +.
Keyboard Shortcuts For Subscript in Google Docs CTRL +,
To undo formatting we can use the same key combination.