Put the cursor to the first line of the selection you want to comment out, and mark it by typing ma,
then go to the last line of the selection and mark it by mb, then use the command:
:'a,'bs/^/#/
you can also just put the cursor to the last line of the selection without marking it, and use:
:'a,s/^/#/
|