Wow. This is incredibly basic stuff.
If the partial pressure of the inert gas you are inspiring is greater than the partial pressure of the inert gas that is absorbed in your tissues, you on-gas. If the partial pressure of the inert gas you are inspiring is less than the partial pressure of the inert gas absorbed in your tissues, you off-gas.
Go from sitting on your couch to 1m in a pool while breathing air, you're on-gassing.
Start breathing a bottle of nitrox (anything > fO2 of 21%) while sitting on your couch, you will begin off-gassing.
The rate of on-gassing / off-gassing will be determined by many things, some of them include the partial pressure of the inert gas you're breathing, the tissue saturation, workload, temperature, etc. The greater the partial pressure of inert gas, the greater the rate of absorption. The lower the partial pressure of inert gas, the slower the rate of absorption.
If you stay at 12m during a mandatory staged decompression stop, while breathing 50% nitrox, your rate of off-gassing will be less than if you distributed your stops at 12m, 9m, 6m, and 3m while breathing 50% nitrox. This is because the PN2 at 12m is 1.1, at 9m it is 0.95, at 6m it is 0.8 and at 3m it is 0.65.
It is theoretically possible to do a dive and surface with a lower inert gas load than when you started your dive.