In my grammar book, I have these example statements.
- We were married July 21, 2000, in New York.
- We were married on July 21 in New York.
Is it a rule not to use "on" when the year is included to specify a date?
The on is permitted, but optional, in both cases.
Personally I find it more natural to use on; the on-less version sounds quite formal to me. But the "were married" construction also sounds quite formal to me — I would have written, "We got married on July 21, 2000, in New York" — so maybe the formal style is intentional.
(For what it's worth, I'm an American in my thirties. It wouldn't surprise me if British speakers and/or older speakers would feel differently about either of these.)