Using density functional theory calculations we study atomic, electronic, and magnetic structures and their influence on the topological phase of ${\mathrm{Mn}}_{2}{\mathrm{Bi}}_{2}{\mathrm{Te}}_{5}$ and ${\mathrm{Mn}}_{2}{\mathrm{Sb}}_{2}{\mathrm{Te}}_{5}$ van der Waals compounds. Our results show that the antiferromagnetic topological insulator (AFM TI) phase in ${\mathrm{Mn}}_{2}{\mathrm{Bi}}_{2}{\mathrm{Te}}_{5}$ is robust both to details of the magnetic ordering within its structural units, nonuple layer (NL) blocks, and the type of atomic layer stacking, NaCl-type ABC or NiAs-type ABAC, within the (${\mathrm{MnTe})}_{2}$ sublattice. The structure with the NiAs-type stacking is energetically more favorable for both compounds. However, for ${\mathrm{Mn}}_{2}{\mathrm{Sb}}_{2}{\mathrm{Te}}_{5}$ the AFM TI phase is realized in the unstable structure with ABC stacking while it is a Dirac semimetal in favorable structure with NiAs stacking within a (${\mathrm{MnTe})}_{2}$ sublattice. We also show that imposing the overall ferromagnetic state by applying an external magnetic field can drive the ${\mathrm{Mn}}_{2}\mathrm{Bi}{(\mathrm{Sb})}_{2}{\mathrm{Te}}_{5}$ compounds into different topologically nontrivial phases like axion insulator or Weyl semimetal.