A rotary engine with double rows of pistons belongs to the field of power machinery and consists of a spindle (1), two symmetrical opposite elliptical track groove discs (2), two symmetrical air exhaust double-layered sleeves (3), double-T-shaped rolling connecting rods (4), a bidirectional cylindrical rotating cylinder (5), turning gears (6), gear shafts (7), crank connecting rod piston type single-cylinder engine heads (8), pistons (9), piston rod racks (10), a cylindrical shell (11) and the like. Two or four or a plurality of even-number engine heads (8) are respectively symmetrically mounted on two side surfaces of an engine head tray (12) around centers of the two side surfaces, so that a rotary engine head assembly with double rows of pistons is formed; two rolling connecting rod bearings (18) are inserted into two symmetrical opposite elliptical track grooves (19); and the two piston rod racks (10) and two vertical rod racks (20) are respectively meshed with the two turning gears. The rotary engine is simple and compact in structure, long in service life, stable in running and low in vibration and noise, is high-efficiency, energy-saving and emission-reduction, not only can be made into a gasoline engine, but also can be made into a diesel engine, and is applicable to various types of fuels.