There are different ways of defining "legal".
In a comment, the OP posits that legal could mean
by legal I mean that for a 3x3x3 cube there are exactly 9 tiles with the same color, and there are 6 different colors.
In which case the existence of "legal" colorings not reachable by standard Rubik's cube moves is trivial: observe that a Rubik's cube move only sends
- Corner pieces to corner pieces
- Center pieces to center pieces
- Edge pieces to edge pieces
So if you peel of the Red center piece sticker and swap it with the sticker of a blue edge piece, you will still have 9 "red tiles", but no "red center tile", so it cannot be arrived at by a standard permutation.
Okay so perhaps you want to strengthen the condition on the tiles. May be we amend the definition of legal to be
A color configuration is legal if there are 6 total colors, each color has 9 tiles, and of the 9 tiles you have 1 center piece, 4 corner pieces, and 4 edge pieces.
This is still not sufficient to guarantee that the cube is solvable. One property of the standard Rubik's cube moves is that opposite centers can never be made adjacent. So take a solved standard cube, with (assuming) white being the top face, blue being the bottom face, and red being a side face. If you take an arbitrary edge sticker off the blue side, and swap it with the red edge sticker that is adjacent to the white face you've created an impossible cube, because the cube now has an edge face with white/blue, but white and blue centers can never be adjacent.
So okay, that is still a trivial impossibility. Perhaps we need to strengthen our definitions even more. The next natural assumption is then
In a solved cube there are 12 edges and 8 corners. Each edge has two colors. Each corner has 3. We say a color configuration is "legal" if it has 6 total colors, 9 tiles of each color, with 1 in the center, 4 on the edge, and 4 on the corner. Furthermore, we require that the color combinations for the edges and corners are in one-to-one correspondence with those available on a solved cube.
In fact, this turns out to be what I call the "take the cube apart and reassemble" definition. (You'll know what I mean if you've ever tried taking apart a Rubik's cube.)
In this situation there are still impossible configurations: for example, if you pry off one single edge piece and re-insert it "upside down". The proof that such configurations are impossible is more difficult, and requires learning some group theory. (See chapter 11 of this exposition.) But the fundamental idea behind the argument is same as the previous cases: one needs to find "algebraic invariants" which describe the configuration of the cube, and which values are left unchanged by the Rubik's cube moves. By constructing a configuration with a different value for the invariants compared to the solved cube, you obtain an example that can be demonstrated to not be solvable.
In the first example, the algebraic invariants are the "number of edge/center/corner tiles per color". In the second example, the algebraic invariants are "the number of edges shared by two given colors". For the third example, I invite you to read the linked PDF file.
This problem is sufficiently simple that we can solve it without "writing new software" and only having recurse to a CAS for some of the algebra.
We can do both of these by Polya's theorem. First, the improper colorings. We need the cycle index $Z(G_1)$ of the action of the symmetries on the edges. The identity contributes $$a_1^6.$$ Rotations by 120 degrees about an axis connecting a vertex to the center of the opposite face contribute $$8a_3^2.$$ Rotations by 180 degrees about an axis passing through the midpoints of opposite edges fix those edges and pair the remaining ones, to contribute $$3a_1^2 a_2^2.$$
This gives $$Z(G_1) = \frac{1}{12} (a_1^6+8a_3^2+3a_1^2 a_2^2).$$
Substituting with three colors gives
$$1/12\, \left( X+Y+Z \right) ^{6}+2/3\, \left( {X}^{3}+{Y}^{3}+{Z}^{3}
\right) ^{2}+1/4\, \left( X+Y+Z \right) ^{2} \left( {X}^{2}+{Y}^{2}+{Z}^
{2} \right) ^{2}.$$
Evaluating this at $X=1, Y=1$ and $Z=1,$ we get 87, verifying the first result of the OP.
For the proper colorings, recall that $k$-colorings correspond to partitions into $k$ matchings. There is only one structurally distinct partition into 3 matchings, which pairs opposite edges. The action of the symmetry on these three is as follows: the identity contributes $$a_1^3.$$ The rotations by 120 degrees create a single three-cycle, giving $$8 a_3.$$ Finally and surprisingly, the 180 degree rotations map every matching to itself, giving $$3a_1^3.$$ The cycle index $Z(G_2)$ is
$$Z(G_2) = \frac{1}{12} (4a_1^3 + 8a_3).$$
Substituting with three colors now gives
$$1/3\, \left( X+Y+Z \right) ^{3}+2/3\,{X}^{3}+2/3\,{Y}^{3}+2/3\,{Z}^{3}$$
or equivalently
$${X}^{3}+{X}^{2}Y+{X}^{2}Z+X{Y}^{2}+2\,XYZ+X{Z}^{2}+{Y}^{3}+{Y}^{2}Z+Y{Z}^
{2}+{Z}^{3}.$$
The coefficient of $XYZ$ is $2$, once more confirming the result from the OP.
Best Answer
Paint one surface white. Choose one of $5$ remaining colors for the opposite face. The four remaining colors can be split in $3$ ways into pairs and then put in $2$ ways. This gives a total of $5\cdot3\cdot2=30$ possibilities.