Pauvre, in the sense of “not rich”, is always placed after the noun: un homme pauvre, une famille pauvre, une ville pauvre, ...
Pauvre, in the sense of “unfortunate”, is always placed before the noun: un pauvre homme, une pauvre hère, ...
There is a general trend whereby some adjectives have a literal meaning when placed after the noun and a figurative meaning when placed before the noun: un grand homme (a great man) vs. un homme grand (a tall man). There is a difference between pauvre and grand however: the position of pauvre is based on its meaning, whereas grand normally comes before and is only placed after the noun in a few expressions where the figurative meaning kicks in.
In general, there is no rule, and you must look it up in a dictionary.