Multiwavelength study of the gravitationally lensed blazar QSO B0218+357 between 2016 and 2020