Yes. u r right! he knows what the illegal formation is. That's why he changed his MR to Mc immediately after his MC sent-off.
but... at least 3 midfielders, not 2, please double check?
Chris Rath already answered your question above.
If you think the rules as posted here are wrong, you can easily check by playing a friendly with a questionable formation.
~^~*~^~ My opinions are best when taken with a grain of salt. No iodine added. ~^~*~^~