In every case where betrothal takes effect and the Torah did not prohibit the marriage, the offspring follows the male. If a Jewish woman was married to a Kohen, Levi, or Yisrael, the son is like the father.
In every case where betrothal takes effect even though the marriage is prohibited, the offspring follows the blemished party. A woman mamzer married to a Jew or a Jewess married to a mamzer - the child is a mamzer.
In every case where marrying is prohibited to the degree that betrothal does not even take effect, the offspring is a mamzer. This is a person who cohabits with any one of the forbidden relations in the Torah.