The superconducting transition temperatures (Tc) of RbGd2Fe4As4O2, RbTb2Fe4As4O2, and RbDy2Fe4As4O2are 35 K, 34.7 K, and 34.3 K without doping, respectively. For the first time, we have studied the high-temperature nonmagnetic state and the low-temperature magnetic ground state of 12442 materials, RbTb2Fe4As4O2and RbDy2Fe4As4O2, using first principles calculations and comparing them with RbGd2Fe4As4O2. We also performed a detailed study of the effects of lanthanides and bilayer Fe2As2. We predict that the ground state of RbLn2Fe4As4O2(Ln= Gd, Tb, and Dy) is spin-density-wave-type, in-plane, striped antiferromagnets, and the magnetic moment around each Fe atom is about 2μB. We also found that the structural differences caused by the simple ionic radius have little effect on the properties of these three materials. Different lanthanide elements themselves play a major role in the electronic properties of the materials. It can be confirmed that the effect of Gd on RbLn2Fe4As4O2is indeed different from that of Tb and Dy, and the presence of Gd is more conducive to interlayer electron transfer. This means that Gd can transfer more electrons from the GdO layer to the FeAs layer compared to Tb and Dy. Therefore, RbGd2Fe4As4O2has a stronger internal coupling strength of the bilayer Fe2As2layer. This can explain why the Tcof RbGd2Fe4As4O2is slightly higher than that of RbTb2Fe4As4O2and RbDy2Fe4As4O2.