You can locate the commands in the options dialog (Tools -> Options -> Keyboard), and assign whatever keyboard shortcut you want for this. However, in your case it's two commands for "pinning" and two for "unpinning". Another option would be to write a macro that does combines the commands:
Sub DockOutputWindow()
DTE.ExecuteCommand("View.Output")
DTE.ExecuteCommand("Window.Dock")
End Sub
Sub AutoHideOutputWindow()
DTE.ExecuteCommand("View.Output")
DTE.ExecuteCommand("Window.AutoHide")
End Sub
Then you can use the keyboard options to assign shortcut keys to these macros.
Of course you can do this more advanced. Say you have the command "SetCodingMode" that will both dock the output windows and hide the test-result window and "SetTestMode" that does the opposite.