The big IF is the use of nuclear weapons. USA and Russia each have more than 6,000 nuclear warheads, and the rest of the world has somewhere between 1,000 and 1,500. If an all-out nuclear shoot-out begins, most of the world will become a radioactive wasteland frozen by nuclear winter. Since both sides of such a war will recognize this, it may be that neither side is willing to be the one that starts using the nuclear option, no matter how bad things go for their side. Let's assume this is the case.
If Canada is part of the "rest of the world", most troops will likely come by way of Canada, which has the longest land border to the US. The US may respond by bombing any troop transport ships (or all ships, just to be sure) heading for Canada (and Mexico and the US itself). Here, the superior airforce of the US will be an important factor. As of 2019, the US has 14,000 aircraft in service, twice the combined airforces of Russia (4,000) and China (3,000), and likely greater than the rest of the world. Adding to this are short-range missiles that can take battleships.
Naval strength will also be a factor, and here, the US isn't doing as well, with only 400 vessels (excluding patrol ships ), compared to Russia's 300 and China's 500. Russia, in particular, has many vessels designed for Arctic warfare, which is important for transporting troops to Canada.
Unless there are already lots of allied troops in Canada when the war begins, it is likely that the US will invade Canada quickly to better control the Arctic access, and the US could also quickly invade Mexico to control land access by the Central American peninsula. Both will likely lead to a lot of guerilla warfare, with the powerful Mexican drug gangs being a big factor, unless the US strikes a deal with them.
Once land access is controlled, and naval troop access is limited, the US could likely hold out for quite a long time, but the greater manpower and industrial capacity of the rest of the world will eventually overwhelm the US. Once casualties build up, there will likely be a strong call from the US population to surrender.
Should this not happen, and the US be occupied, the occupation is not likely to be peaceful. The size of the US and the number of weapons floating around would allow for large bands of guerillas striking and then dissappearing into the forests, mountains, or suburbs. In time, however, even guerilla warfare will fail, since the rest of the world could easily muster troops for a peace force equal to the entire population of the US. Satellite surveillance could also reveal guerilla strongholds, assuming that all satellites weren't destroyed during the war, leading to so much space debris that deploying new ones is unfeasible.
All this of course assumes a military situation resembling that of today. Future warfare may well be very different, with robots and drones doing most of the fighting.
Source for military statistics: GlobalFirepower.com