Only numbers (1), (2) and (4) are correct; the number (3) is incorrect. Your post provides perfect example sentences to illustrate both cases.
The basic rule about commas before "что" is that you need one in all cases except when "что" is a part of an indivisible compound expression, such as "во что бы то ни стало", "потому что", and so on.
"потому что" is a compound subordinating conjunction (составной подчинительный союз). It is a single part of speech, so normally you should not separate its two parts with a comma. "по-" in "потому" is not a separate word, it is a prefix, so it is written together with "-тому".
"по тому", on the other hand, is a preposition (предлог) followed by a demonstrative pronoun (указательное местоимение). The word "что", a conjunction (изъяснительный союз), is a separate word, so the basic rule applies, i.e. you need a comma.
Using number (2) is an advanced subject. Consider these two comma placements:
Он ей нравился, потому что был очень мужественным.
and
Он ей нравился потому, что был очень мужественным.
Both sentences translate roughly as
She liked him, because he was very courageous.
The difference is that placing the comma before "потому" stresses the the consequence (i.e. the fact that she liked him), while placing the comma before "что" stresses the cause (i.e. the fact that he was courageous). This is called "расчленение союза" (splitting up the conjunction), and it is a somewhat non-trivial subject. You can read more about it here.