These questions seem to be more about logic than language.
As far as language goes, only 1a, 1b and 2b would ever be heard. The others are not idiomatic and would never be spoken or written. But maybe they can be interpreted as logical statements.
1- "Everybody didn't have a book" is logically equivalent to 1b- "Nobody had a book". But 1a- "Not everybody had a book" is different. It allows the possibility that some people had books.
2- "Each of them didn't have a book" is logically equivalent to 2b- "None of them had a book". 2a- "Not each of them had a book" is different, but so syntactically wrong it is impossible to interpret. It could mean "not all of them had a book" or it might mean "each of them had no book".
Idiomatic ways to express 1a and 2a are "Not all of them had books", or "Some of them had no book."