I started with Alan's technique.
Thanks Alan I would not have thought of it myself.
I am thinking of the numbers as four distinct zeros, 4 distinct ones and 4 distinct twos.
I am going to say it is 3 columns and 4 rows with each row adding to a multiple of 3 because that will be much easier for me to work with.
Here is one possibility
0,0,0,0 4! = 24
1,1,2,2 4*3*4*3 * 4!/(2!2!) = 144*6 = 864
1,1,2,2 4! =24
So far I get 24*864*24 = 497664 ways
But the rows can be in any order. I think that is 3 ways =3 ways
So that is 497664*3 = 1 492 992 ways.
Another possibility is
2,2,2,0 4*3*2*4*4 = 384 ways
1,2,0,0 4*1*4*3*(4!/2!) = 48*12 = 576 ways
1,1,1,0 3*2*4 = 24 ways
384*576*24 = 5308416
Times by 6 = 31 850 496 ways
Another possibility is
1,2,0,0 4*4*4*3*(4!/2!) = 193*12 = 2304
1,2,0,0 3*3*2*1*12 = 18* 12= 216
1,2,1,2 2*1*2*1*(4!/4) = 4* 6 = 24
2304*216*24= 11 943 936
Times by 3 = 35 831808
1 492 992+31 850 496+35 831808 = 69 175 296 ways
This does seem like a lot and maybe I have double counted
but if there were no restrictions at all then there would be 12! ways = 479 001 600.
69175296/497001600 = 0.1391852581561106
So my answer is only 14% of all possible answers with no conditions at all.
So it may be correct. It passes my reasonableness test.