How you should handle comments like this will depend on the situation, and what language is used around it.
There is a difference between:
"You're not my father! I hate you!"
"You can't tell me what to do, you're not my father!"
There's also a difference between a flippant remark, meant just to irritate/hurt you, and an outburst used as a final argument when logic and reasoning have been overcome by irrationality and emotions. It's not necessarily an "ultimate" response.
If your child is in a state of emotion that takes them beyond the point of reasoning with them, then the best response would be to ignore the comment itself, despite its sting, and instead hear it as a cue that the situation has escalated too far.
If it's a matter of them saying "I hate you!" along with it, then their statement is pretty much the equivalent of a child saying "I hate you!" to biological parents: That is, it's the most hurtful comment they can think to say at the time. Comments like this likely indicate that the child is beyond reasoning with, because they're overwhelmed with their feelings, lack of control, hurt, or whatever it may be.
If your child isn't beyond reasoning with, then you could try and respond with calmly with a rebuttal that acknowledges, defeats, and moves past the comment.
"Whether or not you think of me as a father makes no difference here..."
This may apply to instances where they add the "You can't tell me what to do..." type of comments.
As @Lennart says, don't be hurt by his words. Initially, you'll likely be hurt regardless, but being cognizant of why he used those words can help move you from an emotional state to a calm, assertive state. As I mentioned, used these words as an indicator. Either the situation has become too hot to touch, or your child is feeling a mix of emotions that's causing him to lash out.
In most cases of conflict, it's best not to focus on the hurtful words themselves, but the emotions and intent behind those words. Your child may curse at you, call you names, say you're not his father, or any number of things to rile you up. It won't help the situation in the present or the future to bring up that, "You said such and such."
If the situation is too emotional for any party involved (which is likely going to be the case), then I'd step back and not address the comments later. When you're able to have a calm moment with your child, you could start a discussion about how you're not his biological father, but you're his parent/have his best interest in mind/are concerned for him/love him. This may seem as if it conflicts with my last paragraph, but the difference is that you're not holding his words against him and are addressing the intent of the words, not the words themselves.
Whenever this discussion happens, don't:
- Ask/demand the child to apologize for saying it. It's counterproductive and puts them back on the defensive.
- Focus on the fact that it hurt your feelings. Your goal isn't to make them feel guilty about that comment. Also, this lets them know that using such comments will be effective in the future.
Something else you should do is keep in mind that you're not alone. Non-biological guardians are increasingly common. Unions where at least one person already had a child, same-sex marriages with adoption, children living with relatives, and adoptions are all examples of families with parents who may have heard "You're not my real parent!"