Who told you it was illegal and what did they say?

To be legal, a formation must have:
- a goalkeeper, this goes without saying
- at least 1 ST
- at least 3 defenders
- at least 1 but not more than 2 players on each flank, so 1 or 2 players on each flank
- at least 4 players in the opponent's half, M row and ahead
- at least 1 midfielder (ML/MC/MR)