How to merge spatially separated polygons into one feature in QGIS?
Have you already tested the 'Singleparts to multipart' tool in the processing toolbox? This should do the job.
If you wnat keep any other features in the layer (besides theese in your example) single, you can select required features and perform Merge Selected Features in editing. This option is in Advanced Digitizing Toolbar, you can activate it in menu View --> Toolbars