"When I critcise you, you start criticising me for something that's bad in me instead of correcting yourself. In this way, you think we are even and you don't have to correct yourself because I have some bad habits too."
Or more modern name than one proposed by nene: "whataboutism".
This is called the
Tu quoque fallacy,
or the appeal to hypocrisy. It's an attempt to discredit a statement by saying that the speaker of the statement is guilty of the same problem.
As with all fallacies of irrelevance, sometimes the situation is relevant. This is more familiarly referred to as 'the pot calling the kettle black'.
This could also be
ad hominem ADVERB & ADJECTIVE
1 (of an argument or reaction) directed against a person rather than the position they are maintaining.