A stacking machine for forming packages of longitudinal metal sections, the machine comprising: - a transferring unit, defining a feed direction of the sections, - a gripping station of the sections arranged on said transferring unit, - the transferring unit being adapted to convey at least one layer of said sections, arranged transversally to the feed direction, to the gripping station; - a delivery station of the sections, arranged at a first end of said transferring unit and accommodating the sections transversally to the feed direction, - a plurality of arms, suitable to rotate about a first rotation axis transversal to said feed direction, - a plurality of magnetic gripping means, each being rotationally fixed to one of said plurality of arms, said magnetic gripping means being suitable to rotate about a second rotation axis, transversal to said feed direction, to magnetically grip said at least one layer of sections from said gripping station and to transfer said at least one layer of sections to the delivery station of the sections, wherein only two control means are provided for controlling the arms and the magnetic gripping means from said gripping station to said delivery station to reach a depositing position (212, 313) of said at least one layer, and vice versa, wherein a first control means of said two control means is configured to control a respective rotation of the plurality of arms in only one sense of rotation during machine operation, wherein a second control means of said two control means is configured to control respective rotations of the plurality of magnetic gripping means, said respective rotations occurring alternatively in a first sense of rotation and in a second sense of rotation reversed with respect to the first sense of rotation, wherein the arms are integrally mounted onto a first single transmission shaft defining said first rotation axis, wherein said first control means control the actuation of said first transmission shaft, characterised in that said second control means control the actuation of a second transmission shaft positioned outside the radius of action of the arms and of the magnetic gripping means, in that the magnetic gripping means are integrally mounted onto respective rotating axles, positioned transversally on the arms and defining said second rotation axis, and in that connection kinematics are provided between the second transmission shaft and each rotating axle. - a transferring unit, defining a feed direction of the sections, - a gripping station of the sections arranged on said transferring unit, - the transferring unit being adapted to convey at least one layer of said sections, arranged transversally to the feed direction, to the gripping station; - a delivery station of the sections, arranged at a first end of said transferring unit and accommodating the sections transversally to the feed direction, - a plurality of arms, suitable to rotate about a first rotation axis transversal to said feed direction, - a plurality of magnetic gripping means, each being rotationally fixed to one of said plurality of arms, said magnetic gripping means being suitable to rotate about a second rotation axis, transversal to said feed direction, to magnetically grip said at least one layer of sections from said gripping station and to transfer said at least one layer of sections to the delivery station of the sections, wherein only two control means are provided for controlling the arms and the magnetic gripping means from said gripping station to said delivery station to reach a depositing position (212, 313) of said at least one layer, and vice versa, wherein a first control means of said two control means is configured to control a respective rotation of the plurality of arms in only one sense of rotation during machine operation,