Need help with some logic in my sketch.

what I need is some kind of counter to show when the door is open and when the door is off

What you need to do is explain things clearly. A counter counts events. You might count the number of times the door is opened. You might count the number of times the door falls off.

You might increment the counter when the door is opened, and decrement the counter when the door is closed.

I have no idea what you mean by "when the door is off". The door does not have an on/off state, normally. Switches have on/off states. In particular, the open/closed limit switches have states.

What is it you want the Arduino to detect and report? Using what external hardware?