This question is not related to any ongoing event, but, rather, is a hypothetical scenario.
Suppose country X invades country Y. While country X possess much advantage in power and dominance over country Y, country Y knows that its under a threat of permanent destruction and might cease to exist. Thus, country Y resorts to performing war crimes against country X on country Y's territory for the purpose of survival (such as use of internationally banned weapons, executions, psychological terror,...) in such a hypothetical scenario would the international community hold country Y accountable for war crimes and for breaking the Geneva protocol or is there some UN resolution that justifies country Y's action as self defense?