Is there a particular circumstance where the U.S. president can be tried for declaring war against another country? What are the criteria for the president to be tried for declaring war? Is there even a set criteria, or is the president immune in this situation no matter how or why the war was declared?
The President can’t declare war
It’s not a power given to the President, the Constitution reserves it for Congress - Article One, Section Eight:
Congress shall have power to ... declare War
Congress has declared war 11 times, the last being on June 4, 1942. Declarations of war are largely an anachronism.
However, that just begs the question ...
Is there a particular circumstance where the U.S. president can be tried for [engaing in military action] against another country?
If the President authorizes military action that is or is conducted in a manner that is against US domestic law then she can be impeached by the House and tried by the Senete.
If it is a violation of international law then she could be tried by an International War Crimes Tribunal. However, this could not be the International Criminal Court since the US does not acknowledge its jurisdiction. It would need to be a tribunal established by the UN which means not vetoed by the USA - an unlikely circumstance.
If he came into the custody of a foreign power, then they could try him under their own laws assuming they were willing to ignore the principle of sovereign immunity.
If they did, and if they did without the approval of the respective body of the UN and/or if the U.S. military actually therein engaged in a war crime, the International Court of Justice at The Hague might claim jurisdiction and the U.S., as it provided before, would not acknowledge the ICC’s jurisdiction or be subjected thereto would be my wild guess.
Specifically, the ICC may issue different forms of warrants or similar notices for the arrest or detention of persons it orders to appear before it.
Last year, “Iran  issued an arrest warrant for Trump over the killing of Qassem Soleimani, and asked Interpol to help detain him” according to a major U.S. medium.
Other than declaring that the U.S. would not be subjected to the jurisdiction of ICC, “[o]n June 11, President Donald Trump issued an executive order (E.O.) authorizing the imposition of sanctions in the form of visa/travel restrictions and asset freezes targeting International Criminal Court (ICC) officials as well as other persons that contribute to the Court’s investigations against the United States and its allies. During the announcement of the sanctions regime, Attorney General William Barr indicated that the U.S. Department of Justice initiated domestic investigations into officials at the ICC’s Office of the Prosecutor for corruption and malfeasance” according to justsecurity.org.
Furthermore, the Appeals Chambers of the ICC approved the investigation of U.S. officials ; however, the U.S. made its position
If the U.S. would be a party to the Rome Treaty on the ICC by a binding Treaty, that would mean that its decisions are the “supreme Law of the Land” (Article VI, Clause 2 of the U.S. Constitution); however, the Rome Statute of the International Criminal Court was not entered into by the U.S. as a party, it only was a signatory to the Treaties, and later withdrew.
Effectively, the hypothetical, in a form, already occurred, and we saw the outcome.