The rule from mtgcommander.net is:
If a Commander would be put into a library, hand, graveyard or exile from anywhere, its owner may choose to move it to the command zone instead.Any time a commander changes zones, its controller gets to choose weather to allow that zone change or to have that commander go to the command zone. Just like when your commander dies, you get to choose graveyard or command zone; it doesn't matter weather the commander was targeted by
Murder or died to
Wrath of God. Same with getting shuffled; you get to choose library or command zone.