The two are easy to distinguish if you think about what word they are followed by:
nach (preposition): followed by a noun
nachdem (conjunction): followed by a verb structure
ex.: Nachdem sie nach Hause gelaufen war, suchte sie nach dem Schlüssel. (don't mix up nachdem and nach dem!)
German's a b*** but worth the trouble :-)