Based on the first-principles calculations and theoretical analysis, we investigate the electronic structures, topological phase transition (TPT) and topological properties of layered magnetic compound MnSb2Te4. It has the similar crystal and magnetic structure as the magnetic topological insulator MnBi2Te4. We find that when the spin-orbit coupling (SOC) is considered, the band structure of MnSb2Te4 in antiferromagnetic (AFM) state has no band inversion at {Gamma}. This is due to the SOC strength of Sb is less than that of Bi. The band inversion can be realized by increasing the SOC of Sb by 0.3 times, which drives MnSb2Te4 from a trivial AFM insulator to an AFM topological insulator (TI) or axion insulator. Uniaxial compressive strain along the layer stacking direction is another way to control the band inversion. The interlayer distance shorten by 5% is needed to drive the similar TPT. For the ferromagnetic (FM) MnSb2Te4 with experimental crystal structure, it is a normal FM insulator. The band inversion can happen when SOC is enhanced by 0.1 times or the interlayer distance is decreased by more than 1%. Thus, FM MnSb2Te4 can be tuned to be the simplest type-I Weyl semimetal with only one pair of Weyl nodes on the three-fold rotational axis. These two Weyl nodes are projected onto (1-10) surface with one Fermi arc connecting them.