This is called concatenation and requires nested fields using If fields. See
Making your mail merge “intelligent” by using IF fields for an example.
Depending on where you are getting your source data for the merge (eg Microsoft Access), it may be simpler to build a SQL query there which uses the CONCAT function to do the tricky stuff so that the Word Mail Merge simply grabs that result. Threads like the following might give you clues (or keywords you can search further on).
Concatenate fields and insert comma between: how to handle nulls – SQLServerCentral Forums