Difference between "shall not exceed XXX" and "may be XXX but not longer"
The candidate's statement shall not exceed two hundred words.
The candidate's statement may be two hundred words but not longer.
I think there is no difference in meaning between these sentences, but I'm uncomfortable with the first one. Can I always use the second one in any case? Or is the first sometimes preferable?
The first way is more succinct and avoids joining parts with "but". It is also more specific as you know that 180 words is acceptable. Written the other way, it is not clear that 180 words is acceptable. Reading it literally, it means that only 200 words is acceptable. It is only when the tailing "but not more" comes along that you guess that less than 200 words is implied. "But not more" is customarily written as "but no more" when referring to a quantity.
In legalese (legal writing), the verb "shall" establishes a firm contractual or legal REQUIREMENT, whereas other verbs ("to be" or "may") do not carry the same implied legal requirement. According to this Wikipedia article, this particular use of "shall" is referred to as "shall" as obligation and has its roots in the original Old English meaning of the word "shall" which implies a social requirement or compact.
I think the first sentence gives a negative meaning, so the main point is restricting the candidate from having a statement longer than 200 words. The second sentence in its turn has a more positive pattern, it states that there is a lot of space to fill, but also kindly reminds that the space is limited however.
The use of "shall" is the proper legalese. It implies no exceptions to the rule, whereas "may" leaves open the unstated possibility. To put it in politer terms than legalese, one could simply say
The candidate's statement may be no more than two hundred words.
which is a succinct way to say the same, leaving open the possibility that less than two hundred words would also be acceptable.