The Rambam writes in Chapter 2 of the Laws For One Who Murders:
One who kills a Jew or kills the slave of a Jew is then given the death penalty... A Jew who kills a righteous non-Jew is not given the death penalty from the court, as it is written, "if a man plots against his fellow," and it is not needed to say that he will be given the death penalty because he killed a non-Jew. And one who kills another's slave (not Jewish) or kills his own slave(not Jewish) is given the death penalty because the slave has accepted upon himself certain commandments and is added to God's portionThat is, that a Jew who kills a non-Jew, even a righteous non-Jew, does not get the death penalty from the court. A righteous non-Jew is one who accepts upon himself the authority of the Jewish court to enforce the Seven Laws of Noah, and he is thus considered a part of the "righteous nations of the world". Similar to what the Rambam wrote in the Laws of Forbidden Acts During Marital Relations (14,7):
Who is considered a righteous non-Jew? One who accepts upon himself not to practice idolatry as well as an acceptance of the other Laws of Noah... Then, he is accepted as righteous and as a part of the righteous nations of the world...A Jew who kills even a righteous non-Jew doesn't get the death penalty at the hands of the court or any other person, and the Rambam emphasizes the difference between a righteous non-Jew and a non-Jewish slave who belongs to a Jew. A non-Jewish slave who belongs to a Jew is a non-Jew who was purchased to be a slave for Jews, and he is in the process of becoming a convert. As a slave he is obligated in all the commandments incumbent upon a woman; and so he is "added to God's portion". None of these things apply to a righteous non-Jew.
In any case, the Rambam only speaks about the punishment here, and it is absolutely forbidden to kill a righteous non-Jew! And, it's not just forbidden to kill him, but a Jew has an obligation to help sustain him! And the words of the Ramabam are exactly such that "one who does kill a righteous non-Jew is not given the death penalty through the court"- meaning that it's still forbidden. The Kesef Mishna says rather that the punishment is from Heaven:
And our master wrote that he is not killed by the court, rather he is killed at the hands of Heaven (for killing a righteous non-Jew)