Make pressing space face player camera towards player's forward facing direction

How do I make the following:

Pressing space will turn the camera towards where your character is facing, holding space will lock the camera to where the player is facing.

If space is being held and player moves, the player will lock facing forward and the player will move backwards or strafe instead.

This is what I have so far: