For it to be a rule of logic, it has to work in
all cases, not just some.
The form:
If x, then y does not imply the form:
If not x, then not y.
"Imply" means it doesn't force the second one to be true. Logic is about deduction: what things
must be true if your original statement is correct. A rule of logic has to work in all cases of that form in order to force truth in the way it does.
So just because "If x, then not y" does work in some case or another, like with square/rectangle, does not mean it is a rule of logic. It has to work in
all cases for it to be a rule of logic.
For example:
"If x, then y" implies "If not y, then not x." There is no counterexample and this works in all cases. "If it is an orange, then it is a fruit" must mean that "If it is not a fruit, then it can't be an orange."
So this is a false counterexample, basic Aristotilian syllogistic logic holds.