How To: Use Your MacBook In Clamshell Mode

See Apple article here.