The experimentally observed selective guest-induced (olefin-induced) magnetism transition from ferromagnetism (FM) to antiferromagnetism (AFM) on Fe/MOF-74 is investigated using the first principles calculations. We reveal that FM in bare MOF is due to direct exchange interaction between neighboring Fe ions while the olefin-adsorbed MOF prefers AFM through the superexchange interaction. We find that geometrical changes (such as Fe-Fe distance and Fe-O-Fe angle) associated with strong interaction of olefin pi-bonds with open metal sites in MOF framework define magnetic coupling while electronic effects such as charge transfer and orbital interaction play a minor role. Additionally, the weak interchain magnetic coupling whose magnitude is smaller than the intrachain coupling by an order of magnitude can be switched by introducing a paramagnetic ligand between metal atoms. This work offers the origin of magnetism in MOFs with open metal sites and its subtle alteration due to selective guest binding that can be used for future design of lightweight porous magnet and magnetic separation of oxygen.