So If I have an 2 amp power supply I can use 1.2 amps on all 4 usb ports and 0.8 for the rest right? But if I use an 3 amp power supply can I then use 1.2 for usb and 1.8 for the rest or 2.2 for all 4 usbs and 0.8 for the rest?
I have an 2 amp power supply I can use 1.2 amps on all 4 usb ports and 0.8 for the rest right?
Well, it could not really be more than that with a properly regulated supply. I'm reasonably certain "1.2 amps on all 4 usb ports" means in total (I think you understand that). So, e.g., you should be able to use 1 A on one port, although I have not tried or heard of this being done.
As John Lewis points out you must set
If I use an 3 amp power supply can I then use 1.2 for usb and 1.8 for the rest or 2.2 for all 4 usbs and 0.8 for the rest?
No you cannot use more than 1.2 A in total for the USB regardless of supply.
Beyond the USB is where things get more interesting, because I don't think the pi sans USB can use 1.8 A. According to this site, which I put an amount of trust in I won't try to justify (you'll have to do that yourself), a maxed out Pi 2B would would use 200 mA for the processor. Which seems very low, but these are the same kind of things that are used in much more energy efficient cell phones -- I think the pi's power hog is actually the RAM, which is cheaper and less power efficient.
Then there's the GPIO pins. Officially the limit here is something like 15-20 mA per pin and 100 mA in total. So not including RAM and other circuitry, we're now at a max of ~300 mA.
But that doesn't include the 3.3V and 5V pins! I think the 3.3V is still limited to 50 - 100 mA, so to be liberal in our estimate, let's go with 500 mA total not including other circuitry.
This is still short of official total numbers which are more in the range of 7-8 hundred mA not including (??) USB and peripherals. Call it a day at 1 amp, which makes sense since all the pis I've tried will run off a quality 1 A supply. I would guess the over-estimation in recommendations has to do with the fact that not all supplies are of the same quality.
But the 5V pins are not regulated, so if you want to try and run a 15 amp circuit that way, go ahead. I am sure you will see sparks and smoke pretty much instantaneously, though. The max safe limit with the 5V pins is a bit of a separate question I won't try to answer, but I think somewhere between 0.5 - 1 amp should be okay.
Short answer: to get 1.2A out of the USB ports, you'll need to set max_usb_current=1 in /boot/config.txt. To get 2A (the max) out, you'll need to change a resistor on the board.
Normal USB ports are limited to supplying 500 mA each, which means 4 ports should draw a maximum of 2 amps. However, the Raspi ports or limited to supplying 600 mA in total, mainly because most microUSB power supplies would only give 1A and the Raspi needs around half of that.
You can increase the total output of the USB ports to 1.2A by modifying the
/boot/config.txt file (I think you need to set
max_usb_current=1). Obviously ensure that you have a good enough supply. If you swap out one of the resistors on the board you can increase the total output to 2amps in total. Instructions on how to do that can be found here