They’re different measurement terms.
The first means that it’s a sensor divided into 2 million receptors to give you a 2mp image - basically telling you nothing useful.
The 2nd means the size of the sensor - generally bigger the better for night vision but you'll find most are around 1/3", it’s not the only deciding factor.