How to get your MacBook to sleep when you close the lid! - Macintosh How To
Here is the behaviour when you close the lid: External Power and External Display: will always stay awake. External Power, no External Display: You can choose stay awake or sleep. Battery Power and External Display: will always go to sleep when closed. To force it to sleep when closed use "Clamshell". To force it to stay awake when closed use "Amphetamine".