Nasdaq is an actual marketplace/exchange. It is like the New York Stock Exchange.
S&P500 is a group of 500 mostly large company stocks from the NYSE and Nasdaq. It just tracks price changes for that basket of stocks.
Dow Jones is a group of 30 mostly large company stocks from the NYSE and Nasdaq. It’s just like the S&P500 but covers less market breadth because it’s only 30 companies instead of 500.
Nasdaq can also refer to the index, which is what you hear in the media. That’s just a method of price tracking all the stocks listed on just the Nasdaq exchange.