If a muslim person says "muslims have sex with goats" infront of some non-muslim people, what is ruling of such a person? Is it obligated to kill such a person? Will allah accept repentance if such a person? Would he be considered an apostate?

If the person said such thing as a joke?

Such action is haram, and the person who do so should be punished, and eating that goat becomes haram.
However the punishment is not execution, and it is not carried out by normal people. It should be applied by the judge.
Any how, if the person practiced this guilt truly repented, Alla swt accepts his repentance.
With regard to considering him apostate, the answer is no.
Such jokes are haram