terrorists usually bomb crowded areas for maximum casualties... bus stations, public markets etc

why would a terrorist go to an apartment building, put a bomb inside a specific apartment? unless the terrorist really intended to kill the occupant/s of the specific apartment. which no longer makes him terrorist but a murderer. in which case why didnt the murderer just use a gun?