1 This request for a preliminary ruling concerns the interpretation of Article 4 of Regulation (EC) No 883/2004 of the European Parliament and of the Council of 29 April 2004 on the coordination of social security systems (OJ 2004 L 166, p. 1 and corrigendum at OJ 2004 L 166, p. 1) and of Article 24 of Directive 2004/38/EC of the European Parliament and of the Council of 29 April 2004 on the right of citizens of the Union and their family members to move and reside freely within the territory of the Member States amending Regulation (EEC) No 1612/68 and repealing Directives 64/221/EEC, 68/360/EEC, 72/194/EEC, 73/148/EEC, 75/34/EEC, 75/35/EEC, 90/364/EEC, 90/365/EEC and 93/96/EEC (OJ 2004 L 158, p. 77, and corrigendum at OJ 2005 L 197, p. 34).
2 The request has been made in proceedings between S, a Union citizen originating in a Member State other than the Federal Republic of Germany, and the Familienkasse Niedersachsen-Bremen der Bundesagentur für Arbeit (Lower Saxony and Bremen Family Allowances Fund of the Federal Employment Agency, Germany; ‘the Family Allowances Fund’) concerning the latter’s rejection of S’s application for family benefits for the period corresponding to the first three months of her residence in Germany.
3 Article 1(j), (k) and (z) of Regulation No 883/2004 contains the following definitions for the purposes of that regulation: ‘(j) “residence” means the place where a person habitually resides; (k) “stay” means temporary residence; … (z) “family benefit” means all benefits in kind or in cash intended to meet family expenses, excluding advances of maintenance payments and special childbirth and adoption allowances mentioned in Annex I.’
4 As regards the scope ratione personae of that regulation, Article 2(1) thereof states: ‘This Regulation shall apply to nationals of a Member State, stateless persons and refugees residing in a Member State who are or have been subject to the legislation of one or more Member States, as well as to the members of their families and to their survivors.’
5 As regards the material scope of that regulation, Article 3(1) thereof provides: ‘This Regulation shall apply to all legislation concerning the following branches of social security: … (j) family benefits.’
6 Article 4 of Regulation No 883/2004 states, under the heading ‘Equality of treatment’: ‘Unless otherwise provided for by this Regulation, persons to whom this Regulation applies shall enjoy the same benefits and be subject to the same obligations under the legislation of any Member State as the nationals thereof.’
7 Article 11 of that regulation lays down the general rules for determining the applicable legislation as follows: ‘1. Persons to whom this Regulation applies shall be subject to the legislation of a single Member State only. Such legislation shall be determined in accordance with this Title. … 3. Subject to Articles 12 to 16: (a) a person pursuing an activity as an employed or self-employed person in a Member State shall be subject to the legislation of that Member State; (b) a civil servant shall be subject to the legislation of the Member State to which the administration employing him/her is subject; (c) a person receiving unemployment benefits in accordance with Article 65 under the legislation of the Member State of residence shall be subject to the legislation of that Member State; (d) a person called up or recalled for service in the armed forces or for civilian service in a Member State shall be subject to the legislation of that Member State; (e) any other person to whom subparagraphs (a) to (d) do not apply shall be subject to the legislation of the Member State of residence, without prejudice to other provisions of this Regulation guaranteeing him/her benefits under the legislation of one or more other Member States. …’
8 Article 11 of Regulation (EC) No 987/2009 of the European Parliament and of the Council of 16 September 2009 laying down the procedure for implementing Regulation No 883/2004 (OJ 2009 L 284, p. 1) provides: ‘1. Where there is a difference of views between the institutions of two or more Member States about the determination of the residence of a person to whom the basic Regulation applies, these institutions shall establish by common agreement the centre of interests of the person concerned, based on an overall assessment of all available information relating to relevant facts, which may include, as appropriate: (a) the duration and continuity of presence on the territory of the Member States concerned; (b) the person’s situation, including: (i) the nature and the specific characteristics of any activity pursued, in particular the place where such activity is habitually pursued, the stability of the activity, and the duration of any work contract; (ii) his family status and family ties; (iii) the exercise of any non-remunerated activity; (iv) in the case of students, the source of their income; (v) his housing situation, in particular how permanent it is; (vi) the Member State in which the person is deemed to reside for taxation purposes. 2. Where the consideration of the various criteria based on relevant facts as set out in paragraph 1 does not lead to agreement between the institutions concerned, the person’s intention, as it appears from such facts and circumstances, especially the reasons that led the person to move, shall be considered to be decisive for establishing that person’s actual place of residence.’
9 Recitals 9, 10, 20 and 21 of Directive 2004/38 state: ‘(9) Union citizens should have the right of residence in the host Member State for a period not exceeding three months without being subject to any conditions or any formalities other than the requirement to hold a valid identity card or passport, without prejudice to a more favourable treatment applicable to job-seekers as recognised by the case-law of the Court of Justice. (10) Persons exercising their right of residence should not, however, become an unreasonable burden on the social assistance system of the host Member State during an initial period of residence. Therefore, the right of residence for Union citizens and their family members for periods in excess of three months should be subject to conditions. … (20) In accordance with the prohibition of discrimination on grounds of nationality, all Union citizens and their family members residing in a Member State on the basis of this Directive should enjoy, in that Member State, equal treatment with nationals in areas covered by the Treaty, subject to such specific provisions as are expressly provided for in the Treaty and secondary law. (21) However, it should be left to the host Member State to decide whether it will grant social assistance during the first three months of residence, or for a longer period in the case of job-seekers, to Union citizens other than those who are workers or self-employed persons or who retain that status or their family members, or maintenance assistance for studies, including vocational training, prior to acquisition of the right of permanent residence, to these same persons.’
10 Article 6 of that directive provides: ‘1. Union citizens shall have the right of residence on the territory of another Member State for a period of up to three months without any conditions or any formalities other than the requirement to hold a valid identity card or passport. 2. The provisions of paragraph 1 shall also apply to family members in possession of a valid passport who are not nationals of a Member State, accompanying or joining the Union citizen.’
11 Article 14(1) of that directive is worded as follows: ‘Union citizens and their family members shall have the right of residence provided for in Article 6, as long as they do not become an unreasonable burden on the social assistance system of the host Member State.’
12 Under Article 24 of that directive: ‘1. Subject to such specific provisions as are expressly provided for in the Treaty and secondary law, all Union citizens residing on the basis of this Directive in the territory of the host Member State shall enjoy equal treatment with the nationals of that Member State within the scope of the Treaty. The benefit of this right shall be extended to family members who are not nationals of a Member State and who have the right of residence or permanent residence. 2. By way of derogation from paragraph 1, the host Member State shall not be obliged to confer entitlement to social assistance during the first three months of residence or, where appropriate, the longer period provided for in Article 14(4)(b), nor shall it be obliged, prior to acquisition of the right of permanent residence, to grant maintenance aid for studies, including vocational training, consisting in student grants or student loans to persons other than workers, self-employed persons, persons who retain such status and members of their families.’
13 Paragraph 62 of the Einkommensteuergesetz (Law on Income Tax), in the version published on 8 October 2009 (BGBl. 2009 I, p. 3366), as amended by the Gesetz gegen illegale Beschäftigung und Sozialleistungsmissbrauch (Law against illegal work and abuse of social benefits, BGBl. 2019 I, p. 1066), and entered into force on 18 July 2019 (‘the EStG’), reads as follows: ‘(1) 1The following persons shall be entitled to family benefits in respect of children within the meaning of Paragraph 63 of the present law: 1. persons whose permanent residence or habitual residence is within the national territory, … 2To be able to claim family benefits under sentence 1, the person entitled must be identified by means of the identification number allocated to him or her … 3The subsequent allocation of an identification number shall have retroactive effect to the months during which the conditions referred to in sentence 1 are met. (1a) 1If a national of another Member State of the Union or a State to which the Agreement on the European Economic Area applies establishes his or her permanent residence or habitual residence within the national territory, he or she shall not be entitled to claim family benefits for the first three months following establishment of that permanent residence or habitual residence. 2This rule shall not apply if that national proves that he or she is in receipt of national income in accordance with points 1 to 4 of sentence 1 of Paragraph 2(1), with the exception of income referred to in point 2 of sentence 1 of Paragraph 19(1). 3Following expiry of the period referred to in sentence 1, that individual shall be entitled to claim family benefits, unless the conditions laid down in Paragraph 2(2) or (3) of the [Gesetz über die allgemeine Freizügigkeit von Unionsbürgern (Law on freedom of movement of Union citizens)] are not met or only the conditions laid down in point 1a of Paragraph 2(2) of the Law on freedom of movement of Union citizens are met without any of the other conditions laid down in Paragraph 2(2) of that law having been met previously. 4The examination to determine whether the eligibility conditions for family benefits are met in accordance with the second sentence shall be at the sole discretion of the Family Allowances Fund … 5Where, in such a case, the Family Allowances Fund rejects an application for family benefits, it must notify its decision to the competent immigration authority. 6Where the applicant has used falsified or altered documents or deception to suggest that he or she is eligible to claim family benefits, the Family Allowances Fund shall immediately advise the competent immigration authority.’
14 The applicant in the main proceedings, S, is the mother of three children born in 2003, 2005 and 2010 respectively. V, her spouse, is the father of those children. Those parents and their children are nationals of a Member State other than the Federal Republic of Germany.
15 In May 2015, S submitted an initial application for family benefits for her three children to the Family Allowances Fund. That body granted that application by decision of 13 May 2015 and started to pay her those benefits on a regular basis, until 3 June 2016. On the latter date, the Family Allowances Fund decided to withdraw its decision of 13 May 2015, to cease paying those benefits to S with effect from May 2016 and to recover from S the family benefits paid in respect of that latter month. That decision followed the automatic deregistration, by the registration authority, of S and her three children from their address in Bremerhaven (Germany), on the ground that their dwelling was empty.
16 In December 2017, S lodged an application for family benefits for two of her three children to the Familienkasse Nordrhein-Westfalen (Family Allowances Fund for North Rhine-Westphalia, Germany), indicating an address in Herne (Germany). Letters sent by that agency to the address indicated were, however, returned to it with the indication ‘addressee unknown’. By decision of 1 August 2018, that agency then rejected S’s application on the ground that she did not have her permanent or habitual residence in Germany.
17 At the end of October 2019, S lodged a new application to the Family Allowances Fund for her three children for the period from 1 August 2019.
18 By decision of 27 December 2019, the Family Allowances Fund rejected that application. That agency found that S, V and their children had resided in Germany since 19 August 2019, that date corresponding to their entry onto the territory of that Member State from their Member State of origin and their taking up residence in an apartment in Bremerhaven (Germany). However, that agency took the view that S had not received national income during the first three months after taking up residence in Germany. That agency therefore decided that she did not meet the conditions laid down in Paragraph 62(1a) of the EStG for entitlement to family benefits for that period.
19 By decision of 6 April 2020, the Family Allowances Fund rejected the complaint made by S against its decision of 27 December 2019, thereby confirming that decision. The Family Allowances Fund took the view that S had not been in gainful employment and that work V had undertaken during the period from 5 November 2019 to 12 December 2019 was minor.
20 S brought an action before the referring court, the Finanzgericht Bremen (Bremen Finance Court, Germany), requesting that the decision to reject her family benefits application be annulled and that the Family Allowances Fund be ordered to pay family benefits for the months of August to October 2019.
21 According to the referring court, in the first place, the family benefits fall within, in Germany, the concept of ‘family benefits’ within the meaning of Article 3(1)(j) of Regulation No 883/2004, read in conjunction with Article 1(z) of that regulation. Family benefits are funded not by the beneficiaries’ contributions, but by tax. The family benefits are granted to beneficiaries on the basis of a legally defined situation, regardless of any income requirement, and without any individual and discretionary assessment of the beneficiaries’ personal needs. Those benefits are intended to meet family expenses.
22 In the second place, the referring court observes that Paragraph 62(1a) of the EStG, resulting from a legislative amendment made in July 2019, applies different treatment for a national of a Member State other than the Federal Republic of Germany who establishes his or her permanent residence or habitual residence in Germany and a German national who establishes his or her permanent residence or habitual residence in Germany following a period of residence in another Member State. Pursuant to that provision, nationals of another Member State, such as S, are refused entitlement to family benefits during the first three months of their residence where they do not provide proof that they were in gainful employment in Germany. In contrast, German nationals are entitled to such benefits as from those first three months even where they are not in gainful employment.
23 In that regard, the referring court states that, in the draft law which led to the addition of subparagraph 1a to Paragraph 62 of the EStG, the German legislature considered that that difference in treatment was compatible with EU law, as it would avoid an influx of nationals from other Member States that would place an unreasonable burden on the German social security system. That difference in treatment is, moreover, justified in the light of Article 24(2) of Directive 2004/38, given that the family benefits granted to nationals of a Member State other than the Federal Republic of Germany who are not in gainful employment in Germany have the same effect on the public finances of that Member State as the grant of social benefits to those nationals. That being said, the German legislature did not explicitly address any potential effect of Article 4 of Regulation No 883/2004 in that draft law. Lastly, through reference to the judgment of 14 June 2016, Commission v United Kingdom (C‑308/14, EU:C:2016:436), the German legislature justified that unequal treatment by the need to protect the finances of the host Member State.
24 In the third place, the referring court states that the question whether the family benefits at issue in the main proceedings fall within the concept of ‘social assistance’, within the meaning of Article 24(2) of Directive 2004/38, is, however, the subject of doctrinal debate. Thus, it is argued inter alia that those family benefits are not covered by that concept, but constitute, as ‘family benefits’, within the meaning of Article 3(1)(j) of Regulation No 883/2004, read in conjunction with Article 1(z) thereof, social security benefits in the strict sense of the term, since they are not means-tested. It is true that, in such a case, in accordance with Regulation No 883/2004, the Federal Republic of Germany is competent to determine the conditions for granting family benefits to nationals of other Member States resident in Germany not in gainful employment there. However, that regulation lays down, in Article 4, an obligation to ensure equal treatment under which nationals of another Member State must be subject to the same conditions of entitlement as those which apply to nationals of that State. That regulation does not contain any provision allowing for a difference in treatment such as that observed in the present case.
25 Ultimately, the outcome of the dispute in the main proceedings depends, according to the referring court, on whether the direct discrimination established by Paragraph 62(1a) of the EStG is precluded by Article 4 of Regulation No 883/2004 or whether it may be justified on the basis of the derogation from the principle of equal treatment referred to in Article 24(2) of Directive 2004/38.
26 In those circumstances, the Finanzgericht Bremen (Bremen Finance Court) decided to stay the proceedings and to refer the following question to the Court of Justice for a preliminary ruling: ‘Must Article 24 of Directive [2004/38] and Article 4 of Regulation [No 883/2004] be interpreted as precluding legislation of a Member State under which a national of another Member State, who establishes a permanent residence or habitual residence in the Member State concerned and does not prove that he has national income from agriculture and forestry, business, employment or self-employment, has no entitlement to family benefits within the meaning of Article 3(1)(j) of Regulation [No 883/2004], in conjunction with Article 1(z) thereof, for the first three months of establishing a permanent residence or habitual residence, whilst a national of the Member State concerned, who is in the same situation, does have an entitlement to family benefits within the meaning of Article 3(1)(j) of Regulation [No 883/2004], in conjunction with Article 1(z) thereof, without proving national income from agriculture and forestry, business, employment or self-employment?’
27 By its question, the referring court asks, in essence, whether Article 4 of Regulation No 883/2004 and Article 24 of Directive 2004/38 must be interpreted as precluding legislation of a Member State under which a Union citizen, who is a national of another Member State, who has established his or her habitual residence on the territory of the first Member State and who is economically inactive in so far as he or she is not in gainful employment in that State, is refused an entitlement to ‘family benefits’, within the meaning of Article 3(1)(j) of Regulation No 883/2004, read in conjunction with Article 1(z) thereof, during the first three months of his or her residence in the territory of that Member State, whereas an economically inactive national of that Member State is entitled to such benefits, including during the first three months following his or her return to the same Member State after having made use, under EU law, of his or her right to move and reside in another Member State.
28 In the first place, according to settled case-law of the Court, the status of citizen of the Union is destined to be the fundamental status of nationals of the Member States, enabling those among such nationals who find themselves in the same situation to enjoy the same treatment in law irrespective of their nationality, subject to such exceptions as are expressly provided for in that regard (see, to that effect, judgments of 20 September 2001, Grzelczyk, C‑184/99, EU:C:2001:458, paragraph 31, and of 15 July 2021, The Department for Communities in Northern Ireland, C‑709/20, EU:C:2021:602, paragraph 62).
29 Every citizen of the Union may therefore rely on the prohibition of discrimination on grounds of nationality laid down in Article 18 TFEU, provided for in other TFEU provisions, in Article 4 of Regulation No 883/2004 and in Article 24 of Directive 2004/38, in all situations falling within the scope ratione materiae of EU law. Those situations include, inter alia, the exercise of the freedom to move and reside within the territory of the Member States conferred by Article 21 TFEU, subject to the limitations and conditions laid down by the Treaties and the measures adopted pursuant to them (see, to that effect, judgments of 20 September 2001, Grzelczyk, C‑184/99, EU:C:2001:458, paragraphs 32 and 33; of 21 February 2013, N., C‑46/12, EU:C:2013:97, paragraph 28; and of 15 July 2021, A (Public health care), C‑535/19, EU:C:2021:595, paragraphs 40 and 42).
30 Directive 2004/38 lays down such limitations and conditions. That directive introduced a gradual system as regards the right of residence in the host Member State, which reproduces, in essence, the stages and conditions laid down in the various instruments of EU law and case-law preceding that directive and culminates in the right of permanent residence (judgment of 21 December 2011, Ziolkowski and Szeja, C‑424/10 and C‑425/10, EU:C:2011:866, paragraph 38).
31 As regards the first three months of residence in the host Member State, to which the question referred for a preliminary ruling relates, Article 6(1) of that directive provides that Union citizens have the right of residence on the territory of another Member State for a period of up to three months without any conditions or any formalities other than the requirement to hold a valid identity card or passport. Article 14(1) of that directive maintains that right as long as Union citizens and their family members do not become an unreasonable burden on the social assistance system of the host Member State (see, to that effect, judgments of 21 December 2011, Ziolkowski and Szeja, C‑424/10 and C‑425/10, EU:C:2011:866, paragraph 39, and of 25 February 2016, García-Nieto and Others, C‑299/14, EU:C:2016:114, paragraph 42).
32 Therefore, a Union citizen, even economically inactive, has, in compliance with the conditions set out in Article 6(1) of Directive 2004/38, read in conjunction with Article 14(1) thereof, a right of residence of three months in a Member State of which he or she is not a national.
33 In the present case, it is apparent from the request for a preliminary ruling that, during the first three months of her residence in Germany, S was legally resident under Article 6(1) of Directive 2004/38, read in conjunction with Article 14(1) thereof.
34 In the second place, it is apparent from the request for a preliminary ruling that the dispute in the main proceedings concerns the grant, by the host Member State, of family benefits, within the meaning of the legislation of that Member State. In that regard, it must be borne in mind that benefits that are granted automatically to families meeting certain objective criteria relating in particular to their size, income and capital resources must be regarded as ‘family benefits’, within the meaning of Article 3(1)(j) of Regulation No 883/2004, read in conjunction with Article 1(z) thereof, without any individual and discretionary assessment of personal needs, and are intended to meet family expenses (see, to that effect, judgments of 14 June 2016, Commission v United Kingdom, C‑308/14, EU:C:2016:436, paragraph 60, and of 21 June 2017, Martinez Silva, C‑449/16, EU:C:2017:485, paragraph 22).
35 It is also apparent from the request for a preliminary ruling that that is the case with regard to the family benefits at issue in the main proceedings, since they are granted to beneficiaries on the basis of a legally defined situation, which is independent of their personal needs, and that their grant is intended not to guarantee their means of subsistence, but to meet family expenses.
36 In addition, it must be borne in mind that Article 11(3)(e) of Regulation No 883/2004 lays down a ‘conflict rule’ intended to determine the national legislation applicable to the receipt of the social security benefits listed in Article 3(1) of that regulation, which include family benefits, which may be claimed by all persons other than those referred to in Article 11(3)(a) to (d) of that regulation, that is to say, inter alia, economically inactive persons. It follows from the application of that rule that the latter persons are, in principle, subject to the law of the Member State in which they reside (see, to that effect, judgments of 14 June 2016, Commission v United Kingdom, C‑308/14, EU:C:2016:436, paragraph 63, and of 15 July 2021, A (Public health care), C‑535/19, EU:C:2021:595, paragraph 45). Under Article 1(j) of Regulation No 883/2004, the concept of ‘residence’ means, for the purposes of the application of that regulation, the place where the person concerned habitually resides.
37 In the present case, the referring court states that S and her family had established their habitual residence in Germany during the three-month period at issue in the main proceedings. Being economically inactive, S appears therefore to fall within, in accordance with Article 11(3)(e) of Regulation No 883/2004, read in conjunction with Article 1(z) and Article 3(1)(j) of that regulation, German legislation as regards the grant of family benefits.
38 It is with the benefit of those preliminary clarifications that it must be determined whether, where he or she is lawfully resident under Article 6(1) of Directive 2004/38, read in conjunction with Article 14(1) of that directive, an economically inactive Union citizen may rely on the principle of equal treatment with nationals of the host Member State who are economically inactive, who return to that Member State after having made use, under EU law, of their right to move and reside in another Member State, for the purposes of the grant of family benefits, within the meaning of Article 3(1)(j) of Regulation No 883/2004, read in conjunction with Article 1(z) of that regulation.
39 As is apparent from paragraph 27 above, the question referred concerns the interpretation of both Article 4 of Regulation No 883/2004 and Article 24 of Directive 2004/38, in so far as those two provisions set out the principle of equal treatment in their respective field of application.
40 In so far as that question is related, in particular, to the determination of the scope of Article 24(2) of Directive 2004/38, it is necessary to determine the scope of that provision before examining that of Article 4 of Regulation No 883/2004.
41 Article 24(1) of Directive 2004/38 provides that all Union citizens residing on the basis of that directive in the territory of the host Member State are to enjoy equal treatment with the nationals of that Member State within the scope of the Treaty.
42 The principle of equal treatment thus benefits any Union citizen whose residence in the territory of the host Member State complies with the conditions laid down in that directive (see, to that effect, judgments of 11 November 2014, Dano, C‑333/13, EU:C:2014:2358, paragraph 69, and of 25 February 2016, García-Nieto and Others, C‑299/14, EU:C:2016:114, paragraph 38 and the case-law cited).
43 However, Article 24(2) of Directive 2004/38 allows a derogation from the principle of equal treatment enjoyed by Union citizens other than workers, self-employed persons, persons who retain such status and members of their families who reside within the territory of the host Member State, by permitting that State not to confer entitlement to social assistance, in particular for the first three months of residence (judgment of 19 September 2013, Brey, C‑140/12, EU:C:2013:565, paragraph 56 and the case-law cited).
44 The host Member State may therefore rely on the derogation in Article 24(2) of Directive 2004/38 in order to refuse to grant a Union citizen who exercises his or her right of residence in the territory of that Member State social assistance during the first three months of that residence (see, to that effect, judgment of 25 February 2016, García-Nieto and Others, C‑299/14, EU:C:2016:114, paragraph 43 and the case-law cited).
45 It is therefore necessary to determine whether the family benefits at issue in the main proceedings constitute ‘social assistance’ within the meaning of Article 24(2) of Directive 2004/38.
46 In that regard, the Court has already held that the concept of ‘social assistance’, within the meaning of the latter provision, refers to all assistance schemes established by the public authorities, whether at national, regional or local level, to which recourse may be had by an individual who does not have resources sufficient to meet his or her own basic needs and those of his or her family and who by reason of that fact may, during his or her period of residence, become a burden on the public finances of the host Member State which could have consequences for the overall level of assistance which may be granted by that State (judgments of 19 September 2013, Brey, C‑140/12, EU:C:2013:565, paragraph 61, and of 11 November 2014, Dano, C‑333/13, EU:C:2014:2358, paragraph 63).
47 As has been pointed out in paragraph 35 of the present judgment, the family benefits at issue in the main proceedings are granted independently of the individual needs of the beneficiary and are not intended to cover his or her means of subsistence.
48 Such benefits do not, therefore, as the Advocate General has observed in point 54 of his Opinion, fall within the concept of ‘social assistance’ within the meaning of Article 24(2) of Directive 2004/38.
49 In those circumstances, it remains to be ascertained whether, as the German Government suggested in its written observations, Article 24(2) of Directive 2004/38 must, in the light of its ratio legis, be interpreted as meaning that, as regards the grant of benefits other than ‘social assistance’ within the meaning of that provision, that article nevertheless allows the host Member State to derogate from the equal treatment which Union citizens lawfully residing in its territory must, in principle, receive, under Article 6(1) of that directive, read in conjunction with Article 14(1) thereof.
50 To that end, it must first be recalled that, as a derogation from the principle of equal treatment laid down in the first paragraph of Article 18 TFEU, of which Article 24(1) of Directive 2004/38 is merely a specific expression, Article 24(2) must be interpreted strictly, and in accordance with the provisions of the Treaty, including those relating to Union citizenship (see, to that effect, judgments of 21 February 2013, N., C‑46/12, EU:C:2013:97, paragraph 33, and of 6 October 2020, Jobcenter Krefeld, C‑181/19, EU:C:2020:794, paragraph 60).
51 Second, according to settled case-law of the Court, it should be borne in mind that, in interpreting a provision of EU law, it is necessary to consider not only its wording, but also the context in which it occurs and the objectives pursued by the rules of which it is part (judgment of 6 October 2020, Jobcenter Krefeld, C‑181/19, EU:C:2020:794, paragraph 61 and the case-law cited).
52 First of all, as regards Article 24(2) of Directive 2004/38, there is nothing in the wording of that provision to suggest that, by that provision, the EU legislature intended to allow the host Member State to derogate from the principle of equal treatment to which Union citizens legally resident in its territory must in principle be entitled in respect of benefits other than social assistance. On the contrary, as the Advocate General observed in point 57 of his Opinion, it is clear from that provision that it concerns only social assistance.
53 Next, as regards the regulatory context of Article 24(2) of Directive 2004/38, it should be recalled that, as is apparent from paragraph 31 above, Article 14(1) of that directive maintains the right of residence of up to three months as long as Union citizens and their family members ‘do not become an unreasonable burden on the social assistance system of the host Member State’. Article 14 thus supports the interpretation that the possibility of derogating from the principle of equal treatment, on the basis of Article 24(2) of Directive 2004/38, is limited to social assistance and that it cannot extend to social security benefits.
54 Finally, that interpretation is consistent with the objective of Article 24(2) of Directive 2004/38, which aims, according to recital 10 of that directive, to maintain the financial balance not of the social security system of the Member States but of their ‘social assistance system’.
55 It follows that, as the Advocate General observed, in essence, in point 62 of his Opinion, the derogation from the principle of equal treatment provided for in Article 24(2) of Directive 2004/38 is not applicable to a situation in which, during the first three months of his or her residence in the host Member State, a Union citizen does not seek ‘social assistance’, within the meaning of that provision, but rather ‘family benefits’, within the meaning of Article 3(1)(j) of Regulation No 883/2004, read in conjunction with Article 1(z) of that regulation.
56 As a preliminary point, it should be recalled that a Union citizen who is economically inactive and has transferred his or her habitual residence to the host Member State is subject, in accordance with Article 11(3)(e) of Regulation No 883/2004, to the legislation of that Member State as regards the grant of social security benefits.
57 In that regard, the Court has already held that that provision is intended not only to prevent the concurrent application of a number of national legislative systems to a given situation and the complications which may ensue, but also to ensure that persons covered by that regulation are not left without social security cover because there is no legislation which is applicable to them (judgments of 14 June 2016, Commission v United Kingdom, C‑308/14, EU:C:2016:436, paragraph 64, and of 15 July 2021, A (Public health care), C‑535/19, EU:C:2021:595, paragraph 46).
58 That being said, Regulation No 883/2004 does not set up a common social security scheme, but allows different national social security schemes to exist and its sole objective is to ensure the coordination of those schemes in order to guarantee the effective exercise of the freedom of movement of persons. Its provisions, such as Article 11(3)(e) thereof, are not, therefore, intended to determine the substantive conditions for entitlement to social security benefits (see, to that effect, judgment of 14 June 2016, Commission v United Kingdom, C‑308/14, EU:C:2016:436, paragraphs 65 and 67). While the Member States thus remain competent to determine in their legislation the conditions for the grant of those benefits, that competence must however be exercised in compliance with EU law (see, to that effect, judgment of 11 April 2013, Jeltes and Others, C‑443/11, EU:C:2013:224, paragraph 59).
59 In that regard, Article 4 of Regulation No 883/2004 gives specific expression to the principle of equal treatment with regard to Union citizens who rely, in the host Member State, on the social security benefits referred to in Article 3(1) of that regulation (see, to that effect, judgment of 15 July 2021, A (Public health care), C‑535/19, EU:C:2021:595, paragraph 40).
60 In accordance with Article 4, unless otherwise provided for by Regulation No 883/2004, persons to whom that regulation applies are to enjoy the same benefits and are to be subject to the same obligations under the legislation of any Member State as the nationals thereof.
61 As the Advocate General observed in point 71 of his Opinion, Regulation No 883/2004 does not contain any provision which would allow the host Member State of a Union citizen, who is a national of another Member State lawfully resident in the first Member State, to operate, in the light of the fact that that citizen is economically inactive, a difference in treatment between that citizen and its own nationals as regards the conditions for the grant of ‘family benefits’ within the meaning of Article 3(1)(j) of that regulation, read in conjunction with Article 1(z) thereof. Accordingly, Article 4 of that regulation precludes a measure which applies such a difference in treatment.
62 Admittedly, the Court has already ruled that there is nothing to prevent the granting of benefits falling within the scope of Regulation No 883/2004 to economically inactive Union citizens being made subject to the requirement that those citizens fulfil the conditions for possessing a right to reside lawfully under Directive 2004/38 in the host Member State (see, to that effect, judgments of 19 September 2013, Brey, C‑140/12, EU:C:2013:565, paragraph 44; of 11 November 2014, Dano, C‑333/13, EU:C:2014:2358, paragraph 83; and of 14 June 2016, Commission v United Kingdom, C‑308/14, EU:C:2016:436, paragraph 68).
63 That being said, a Union citizen residing in the territory of the host Member State pursuant to Article 6(1) of Directive 2004/38, read in conjunction with Article 14(1) thereof, is, as is apparent from paragraphs 31 to 33 of the present judgment, lawfully resident there, within the meaning of that directive.
64 It follows that such a Union citizen benefits from the principle of equal treatment with the nationals of that Member State laid down in Article 4 of Regulation No 883/2004, including if he or she is economically inactive during the first three months of his or her residence in that Member State pursuant to the provisions of Directive 2004/38 referred to in the preceding paragraph.
65 It results from the foregoing considerations that an economically inactive Union citizen who resides, pursuant to Article 6(1) of Directive 2004/38, read in conjunction with Article 14(1) thereof, in the territory of a Member State other than that of which he or she is a national and who has established his or her habitual residence in that territory may rely, in the host Member State, on the principle of equal treatment, laid down in Article 4 of Regulation No 883/2004, for the purposes of obtaining family benefits, within the meaning of Article 3(1)(j) of that regulation, read in conjunction with Article 1(z) thereof.
66 Consequently, since Article 4 of Regulation No 883/2004 specifies the principle of equal treatment as regards access to such benefits, it is necessary to examine whether national legislation such as that referred to in paragraph 27 of the present judgment constitutes a difference in treatment contrary to that provision.
67 Legislation of the host Member State which excludes entitlement to family benefits, within the meaning of Regulation No 883/2004, to a Union citizen even though he or she is lawfully resident, pursuant to Article 6(1) of Directive 2004/38, read in conjunction with Article 14(1) thereof, in the territory of that Member State and even though he or she has established his or her habitual residence there, on the ground that that citizen is economically inactive, whereas that same Member State grants such benefits to its own nationals, even if they are economically inactive, as soon as they return to that Member State after having exercised their right to move and reside in the territory of another Member State under EU law, constitutes direct discrimination of a Union citizen.
68 As the Advocate General observed in point 73 of his Opinion and in the light of what has been stated in paragraph 61 above, such discrimination cannot, in the absence of any derogation expressly provided for in Regulation No 883/2004, be justified.
69 Accordingly, Article 4 of Regulation No 883/2004 must be interpreted as precluding the host Member State from adopting legislation such as that referred to in paragraph 67 above.
70 It must, however, be stated that a Union citizen, who is economically inactive and who claims, in the host Member State, the application of the principle of equal treatment enshrined in that article as regards the conditions for the grant of family benefits, within the meaning of Regulation No 883/2004, must, pursuant to Article 2(1) of that regulation, read in conjunction with Article 1(j) thereof, have established, during the first three months in which he or she receives, in that Member State, a residence permit in accordance with Article 6(1) of that regulation, read in conjunction with Article 14(1) thereof, his or her habitual residence in that Member State and not be resident there temporarily, within the meaning of Article 1(k) of that regulation.
71 In that regard, first, Article 11 of Regulation No 987/2009, entitled ‘Elements for determining residence’, identifies, in paragraph 1, a number of elements for the purposes of determining the Member State in which the person concerned resides. Paragraph 2 of that article states that the concept of ‘residence’, within the meaning of Regulation No 883/2004, means the ‘actual’ residence of that person.
72 Second, in accordance with the case-law of the Court, the concept of ‘habitual residence’ essentially reflects a question of fact submitted for assessment by the national court in the light of all the particular circumstances of the case. In that regard, it should be noted that the condition that a Union citizen such as referred to in paragraph 70 above must have transferred his or her habitual residence to the territory of the host Member State implies that he or she has manifested his or her intention to establish, in actual fact, the habitual centre of his or her interests in that Member State and that he or she shows that his or her presence on the territory of that Member State demonstrates a sufficient degree of stability, which distinguishes it from temporary residence (see, by analogy, judgment of 25 November 2021, IB (Habitual residence of a spouse - Divorce), C‑289/20, EU:C:2021:955, paragraph 58).
73 In the light of all the foregoing considerations, the answer to the question referred is as follows: - Article 4 of Regulation No 883/2004 must be interpreted as precluding legislation of a Member State under which a Union citizen, who is a national of another Member State, who has established his or her habitual residence on the territory of the first Member State and who is economically inactive in so far as he or she is not in gainful employment in that State, is refused an entitlement to ‘family benefits’, within the meaning of Article 3(1)(j) of that regulation, read in conjunction with Article 1(z) thereof, during the first three months of his or her residence in the territory of that Member State, whereas an economically inactive national of that Member State is entitled to such benefits, including during the first three months following his or her return to the same Member State after having made use, under EU law, of his or her right to move and reside in another Member State. - Article 24(2) of Directive 2004/38 must be interpreted as meaning that it is not applicable to such legislation.
74 Since these proceedings are, for the parties to the main proceedings, a step in the action pending before the referring court, the decision on costs is a matter for that court. Costs incurred in submitting observations to the Court, other than the costs of those parties, are not recoverable.