BOD stands for biochemical oxygen demand. It refers to the amount of the oxygen that would be consumed if all the organic matter in one liter of water were oxidised by bacteria. Its unit is mg/L.
The BOD test is performed to measure the rate of uptake of oxygen by micro-organisms that are present in a sample of water and thus, BOD is an indirect measure of the organic matter present in the water. It is often used in wastewater-treatment plants as an index of the degree of organic pollution in water.
The greater the organic matter present in a water sample, the greater would be its BOD. Greater the BOD, the greater its polluting potential. Therefore, the water sample B which has a greater BOD (8 mg/L) is more polluted than sample A (2 mg/L).