It's often difficult for a native speaker to give rules, so I searched for them and found this book http://polish.slavic.pitt.edu/firstyear/nutshell.pdf . For some rules on imperative check out pages 73-75. However, I'd like to add that:
Nie otwórz drzwi! Watch out, don’t open the door! Don't say that, it's wrong. We say nie otwieraj drzwi as a warning too
1st person singular imperative is very very rarely used, i'd recommend skipping it for now
in formal situations (both in singular and plural) you can also use Proszę + infinitive, np. "Proszę zamknąć okno" = "Please close the window"