Strictly speaking, the 1983 Beirut barracks bombing was an act of proxy warfare, which the United States has also employed, very liberally, throughout its history.
The attack involved a local force and non-state actors, Hezbollah with support from Iran, who targeted military personnel. While suicide bombing is often associated with terrorism, this leads to differing interpretations; primarily because we tend to label our adversaries' tactics as distinct from our own.
Since the French operation and U.S. barracks were clearly military targets, the bombing was technically an act of asymmetric or proxy warfare. The use of unconventional tactics by non-state actors blurs the line between terrorism and military action, but the primary objective was to strike a military force, not civilians.
However, the 1983 U.S. Embassy bombing in Beirut is more complicated but easy to argue an act of war because the embassy was dual use. While an embassy is not a military target, the U.S. embassy in Beirut at the time housed a significant number of military and intelligence personnel involved in coordinating U.S. operations in Lebanon. This would have led attackers to view the embassy as a strategic target, albeit not a strictly military one.
And in this case, it worked. Along with the collapse of the Lebanese military, the U.S. and French forces ultimately withdrew from Lebanon as a result.
A mistake in hindsight.