To capture game footage, make sure the Record in the background while I’m playing a game check box is selected in Game bar settings (or turn it on in
Windows Settings > Gaming > Captures).

For some PC games, Game bar won’t appear full screen. To start and stop recordings without Game bar, use the keyboard shortcut
Windows logo key+ Alt + R. The screen will flash to indicate the start and end of recording. If background recording is on,
Windows logo key+ Alt + G will record the last few moments of play.

If the shortcuts don’t work for a full-screen game, press the Windows logo key+ G. The screen will flash twice to confirm that the game is recognized. Then, re-open the game full screen.