  Perfluorocubane ($C_8F_8$) was successfully synthesized and found to accept
and store electrons in its internal cubic cavity to form magnetic moments.
However their inter-molecule spin-exchange coupling mechanism is yet to be
revealed. In this study, we found the inter-molecule magnetic groundstates of
$C_8F_8$ dimer and one-dimensional (1D) chain are tunable from
antiferromagnetic (AFM) to ferromagnetic (FM) by stacking orders and alkaline
earth metals intercalation using first-principle calculations. The
inter-molecule couplings are dominated by noncovalent halogen $C-F...C_4$
interactions. Stacking orders of dimers can regulate the relative position of
the lone pairs and $\sigma-holes$ at the molecular interface and thus the
magnetic groundstates. Alkaline earth metals M (M = Na, Mg) intercalations
could form $C_4-M-C_4$ bonds and lead to FM direct exchange at the
inter-molecule region. An unpaired electron donated by the intercalated atoms
or electron doping can result in a local magnetic moment in dimers, exhibiting
an on-off switching by the odd-even number of electron filling. Novel
electronic properties such as spin gapless semiconductor and charge density
wave (CDW) states emerge when $C_8F_8$ molecules self-assemble with
intercalated atoms to form 1D chains. These findings manifest the roles of
stacking and intercalation in modifying intermolecular magnetism and the
revealed halogen bond-dominated exchange mechanisms are paramount additions to
those previously established non-covalent couplings.
