Minecraft wiki entry for Development_versions, associated text: Syntax is /spectate [<target>] [<player>].
target – the target entity to spectate.
If omitted, makes the player stop spectating.
player – the player that should spectate the target.
Must be in spectator mode.
If omitted, @s (the executing player) is used.