This command will make your target immune to all damage from combat including, but not limited to: melee, arrows, spells and shouts.
setghost [0 / 1] Target Command
|0 / 1||Specify '1' (without quotes) to put your target in ghost mode. Specify '0' (without quotes) to make your target not be in ghost mode.|
The above command would put your target in ghost mode - making them unaffected by all combat attacks/damage.
This console command would take your target out of ghost mode.