Most single gain non-metallic boxes come in 18, 20 and 22 cubit inches sizes.
314.16 is the section in the code that is used for box fill calculations. Here we are told that every conductor that enters the box counts as one conductor and all the grounds count as one conductor and the device counts as two conductors.
Using 12/2 with ground NM cable and a receptacle we would total all the conductors and multiply this by 2.25. Table 314.16(B) is where we get the multiplier from.
If there were two cables in one box then we would have a total of five conductors, two whites, two blacks and both grounds count as one. The device would be two more bringing our total to seven. 7 x 2.25 = 15.75
If we had three 12/2 with ground we would have a total of nine or 9 x 2.25 = 20.25.
This tell us that a 18 cu. In. box could be used if only two cables were installed but if three cables are installed then the larger 22 cu. In. box would be required.