It is taught in Mishneh Torah that a Gentile merits to have a portion in that future World to Come if he accepts the Seven Noahide Laws and is careful to keep them, provided that he does this because G-d commanded them in the Torah and made it known through Moses that He had previously commanded the Children of Noah about them.
If a Gentile rejects this belief in G-d and the Torah, and rejects being obligated to keep the Seven Noahide Laws, G-d will still reward him for his good deeds, either during his life in this physical world, or spiritually for his soul in its afterlife, or some combination of both.
However, there are also some people who are so bad that they have no portion in the future World to Come, and also no spiritual reward before that, in their afterlife. On account of their serious deliberate, rebellious, and unrepented sins, the good deeds they did are not enough to tip the scale of their judgment by G-d to the side of receiving any spiritual reward, even temporarily.
G-d's judgment that a person will not have a portion in the future World to Come applies if the person dies without having repented. However, if such a person abandons his wicked deeds and attitudes and dies in repentance, he will merit to have a portion in the World to Come, for nothing can stand in the way of repentance. Even if he denies G-d's existence throughout his life and only repents and accepts G-d's Seven Noahide Commandments from the Torah in his final moments, he merits to receive a portion in the World to Come.
Therefore, it is very important to let all Gentiles know about the One G-d and the Seven Laws of Noah. Even if it seems that a particular person rejects this and will never accept it, it may be that the person will repent in his heart in the final moments of his life and accept it, and thereby merit to have a portion in the World to Come. And even if this does not happen, it may be that on account of mitigating circumstances in the person's life that led him astray or did not give him the opportunity to be properly educated or influenced, therefore G-d will send his soul back to the physical world for reincarnation, to give it an opportunity to gain merit in another lifetime when the Noahide Laws are getting more and more publicized, and more and more accepted, as we get closer and closer to the true Messiah's coming - may it be very speedily in our days!
The Lubavitcher Rebbe taught that in connection to the subject of death in the Torah’s precepts of mourning, Rambam wrote in Mishneh Torah, "Anyone who does not mourn [for a deceased close relative] as the Sages commanded is cruel [i.e. insensitive]," and on the other hand, “A person should not feel hurt over the deceased too long, for this is the way of the world, and one who pains himself more than the way of the world is a fool. How should he act? Three days for weeping; seven [i.e. an additional four] for mourning [and continuing to receive those who visit to give words of comfort]; thirty days [total] before hair cutting, etc.;” all the way until those aspects of [customs of] mourning that extend for twelve months [which are mainly for those who lose a parent, G-d forbid]. But afterwards, G-d made it [human] nature that “the deceased are forgotten from the heart" [meaning that the pain of bereavement dissipates and disappears]:
https://asknoah.org/faq/torah-perspective-on-mourning
Rather than saying the Jewish "kaddish" prayer for a departed Gentile soul, here are some prayers that have been recommended for Gentiles to say for departed loved ones:
https://asknoah.org/faq/how-should-noahi...or-friends