^^^ Sanders earns the Democratic nomination each time he runs for Congress by running in their primary. He actually files to run in the Democratic primary each time, is on the Democratic Party primary ballot, and then proceeds to switch to independent as soon as the primary is over. Electoral fusion is a thing in VT, so he runs as an independent with the endorsement of the Democratic Party.
He actually lost the nomination in terms of votes by 91%-6% in 2000 according to Wikipedia (
), but still won the general and apparently was endorsed by the party anyway, with his primary opponent getting just a few percent and running as a candidate for "Organic Life".
He also lost the primary vote in 2004 but was still endorsed by the party. He apparently "declined" the party's nomination in 2006 for Senate despite winning it.