How to use analogWrite() on multiple pins at the same time?
You have your parameters the wrong way round:

analogWrite(2, 100);
analogWrite(6, 200);


However: pin 2 on the Uno cannot do PWM, so you will have to pick a different pin. Look for the pins marked with ~ - they are the PWM pins. On the Uno that is pins 3, 5, 6, 9, 10 and 11.