People keep using the word "whataboutism" and it seems people don't really know what it means, and I don't see how it's a logical fallacy if it's a very good argument. For instance, if the U.S. says that China should be punished for its human right violations, then a valid argument against it would be "Guantalamo Bay" and "the migrant detention centers" for which the U.S. wasn't punished. You could also point out someone's hypocrisy if someone complains about racism and then says something racist and fail to recognize it, especially if you already addressed the points he made. So when exactly is "whataboutism" a fallacy and when is it not?
The “whatabout” argument remains nothing more than the tu quoque fallacy, even in complex or difficult comparisons. Each situation must stand or fall on its own merit.
That said, when there is a comparison that seems to draw a distinction without a difference, it is legitimate to question the standard that is supposedly being applied.
One case where it is not a fallacy is in comparisons with the claiming side. Eg "don't vote for Red because he stole a sheep when he was a lad." "that's very nice, Green, but I recall you stole a camel."
That is, if the issue is less "A is bad" and more "A is worse than me" then it is relevant. Otherwise, it is typically taken to be a special case of a red herring.
Attacking your opponent for hypocrisy is, at its base, attacking your partner, which is the very definition ad hominem and thus a well-known fallacy.
However, their statement, instead of hypocrisy, might also be viewable as an admission of of a cultural valuation, which can then be used against them.
Example: A Republican says Hillary should go to jail because she deleted 30,000 emails.
That's hypocritical when her predecessors as Secretary of State, Rice and Powell, together with the entire G. W. Bush administration, deleted possibly 20 million emails. Furthermore that was done not as a mistake but purposefully.
At this point, you don't win the argument by saying merely that the opponent is hypocritical. Instead, you can accept the yardstick they're handing you: 30,000 accidental deletions are enough to jail? Fair enough. What should we do if it instead were 20 million? And it wasn't just her own emails but those of most of the entire administration? Hear out what punishment they'd suggest in that case. Is that the punishment you're calling for for GW? Or in contrast, if you think GW should get a pass for 20 million purposeful deletions, perhaps HRC's lawyers accidentally deleting 30,000 should likewise get a pass?
For instance, if the U.S. says that China should be punished for its human right violations, then a valid argument against it would be "Guantanamo Bay" and "the migrant detention centers" for which the U.S. wasn't punished.
Since it is the US speaking in your example, you could say it is being hypocritical, but to mention that would be ad hominem. (If it wasn't the US speaking, but say France, speaking, then it's not hypocritical, but just a red herring.)
Instead the US side can benefit from you handing them this yardstick. Uighur re-education camps, unlike the US border camps, 1) imprison only citizens, 2) forcing labor, 3) until custodial whim is met, 4) of people selected for politics and ethnicity, 5) where budgetary factors played no role in incarceration, 6) where internees may find themselves returned time and time again. In contrast the US camps are only for non-citizen potential immigrants (a class with less legal status, if arguably no less moral status), 2) who cannot labor, 3) until their place in an input queue is reached, 4) for anyone no matter race or politics who comes across the southern border, 5) in some large part due to the fact emergency funding has not been forthcoming, 6) and upon exiting will never again find themselves in. Finally, the US internees are about 80,000 in number currently (and 40 people in Guantanamo), vs. estimates into the millions for Uighurs. So if the opponent is claiming the US camps worth some international approbation, then by this yardstick, they pretty much prove the point that the Chinese camps are worthy of a good deal more.
(Note I'm not arguing any of the cases above, merely using them as examples.)
For instance, if the U.S. says that China should be punished for its human right violations, then a valid argument against it would be "Guantalamo Bay". This is actually a good example of the hypocrisy fallacy. The argument does not make a referenced Chinese human rights violation good only that USA also not good. Hypocrisy does not define whether an action of A is good or not because of the actions of B.