First of all, I do not agree with the interpretation that there are entire "sheep nations" and "goat nations", but rather, as the Scriptures indicate, "sheep" and "goats" within every nation on earth.
Secondly, the only thing that "qualifies" anyone to inherit eternal life is that they have done "the will of the Father" and believed on the Son. Salvation is a gift of God, by grace, through faith and not of works. Matthew 25 is often misunderstood to teach that we earn our own salvation.
Matthew 25:
31 When the Son of man shall come in his glory, and all the holy angels with him, then shall he sit upon the throne of his glory:
32 And before him shall be gathered all nations: and he shall separate them one from another, as a shepherd divideth his sheep from the goats:
33 And he shall set the sheep on his right hand, but the goats on the left.
Notice that Jesus separates the sheep from the goats prior to anything being said or any specific criteria being laid out as to what makes one a "sheep" or a "goat". Jesus knows who are His.
34 Then shall the King say unto them on his right hand, Come, ye blessed of my Father, inherit the kingdom prepared for you from the foundation of the world:
We see here that the Kingdom is indeed an "inheritance" which has been prepared for the "sheep" "from the foundation of the world." An inheritance is not something the one receiving it has earned, but rather, they receive it as a gift from another who has earned it.
35 For I was an hungred, and ye gave me meat: I was thirsty, and ye gave me drink: I was a stranger, and ye took me in:
36 Naked, and ye clothed me: I was sick, and ye visited me: I was in prison, and ye came unto me.
And so, after separating the "sheep" from the "goats" and telling the "sheep" that they have their "inheritance" which was prepared for them, Jesus commends them for what they did to serve Him in their lives, by doing the good works they were saved unto.
37 Then shall the righteous answer him, saying, Lord, when saw we thee an hungred, and fed thee? or thirsty, and gave thee drink?
38 When saw we thee a stranger, and took thee in? or naked, and clothed thee?
39 Or when saw we thee sick, or in prison, and came unto thee?
40 And the King shall answer and say unto them, Verily I say unto you, Inasmuch as ye have done it unto one of the least of these my brethren, ye have done it unto me.
And we read here that the "sheep" were not even aware that they had served Jesus in what they were doing. They simply went forward in the joy of their salvation and He worked through them in their lives. Their focus was clearly not on working for or earning their salvation, otherwise they would not have asked these questions.
41 Then shall he say also unto them on the left hand, Depart from me, ye cursed, into everlasting fire, prepared for the devil and his angels:
42 For I was an hungred, and ye gave me no meat: I was thirsty, and ye gave me no drink:
43 I was a stranger, and ye took me not in: naked, and ye clothed me not: sick, and in prison, and ye visited me not.
44 Then shall they also answer him, saying, Lord, when saw we thee an hungred, or athirst, or a stranger, or naked, or sick, or in prison, and did not minister unto thee?
45 Then shall he answer them, saying, Verily I say unto you, Inasmuch as ye did it not to one of the least of these, ye did it not to me.
46 And these shall go away into everlasting punishment: but the righteous into life eternal.
And the same is true for the "goats." They did not belong to Jesus and so they gave no thought to serving Him (specifically by helping believers).
In Matthew 7:21-23, however, we do read of people who boast in their "many wonderful works", which they did in Jesus' name, and Jesus tells them He never knew them.