Article 21 TFEU

1. Every citizen of the Union shall have the right to move and reside freely within the territory of the Member States, subject to the limitations and conditions laid down in the Treaties and by the measures adopted to give them effect.

2. If action by the Union should prove necessary to attain this objective and the Treaties have not provided the necessary powers, the European Parliament and the Council, acting in accordance with the ordinary legislative procedure, may adopt provisions with a view to facilitating the exercise of the rights referred to in paragraph 1.

3. For the same purposes as those referred to in paragraph 1 and if the Treaties have not provided the necessary powers, the Council, acting in accordance with a special legislative procedure, may adopt measures concerning social security or social protection. The Council shall act unanimously after consulting the European Parliament.