To tell the difference, compare these two:
他不去学校。(He is not going to the school. / He doesn't go to the school.)
他没去学校。(He didn't go to the school.)
In the first sentence, the main focus is ---- the action of not going was "made" by "他."
In the second sentence, the main focus is --- he was "not present" or "did not make it" to the school.
IMPORTANT: When using 没 + verb , this indicate an past event. E.g. 没吃 didn't eat, 没喝 didn't drink...etc. Therefore, you can only use 没 for past tense.
Now, put the time phrase 昨天 back into the sentence.
昨天他不去学校。He wasn't going to the school yesterday.
昨天他没去学校。He didn't go to the school yesterday.