DIAGNOSIS The bar nuts aren't the problem. The bar is likely worn unevenly, or the chain tensioning mechanism (the little pin that engages the bar) is broken or not seated right.
FIX With the saw off and cool, loosen the bar nuts. Use the tensioning screw (the one with the plus/minus icon) to adjust the chain until it's snug against the bar but still pulls freely by hand. Now, while holding the bar nose up to keep tension, tighten the front bar nut first, then the rear one. This sequence is key.
IF THAT DIDN'T WORK Inspect the bar rails. If they're spread open or unevenly worn, the chain will just rattle loose. Also, check that the tensioning pin inside the housing is actually moving when you turn the screw.
HEADS UP A new chain on an old, worn bar will also do this. Bars wear out and need replacement eventually—they're a consumable part.