The spots on the upper side of your hands are not pimples. Pimples do not occur there.
They should be what are known as miliaria rubra or more commonly as prickly heat. As a matter of fact, there is no evidence-based treatment for this condition. Avoidance of sunlight, staying in cooler environment, and if necessary the use of a mild topical emollient might help. Some doctors advise calamine lotion for external use. But I have not found it useful and the medication forms cake-like solidifying layer, resulting in more itching. Anti-fungals do not help at all.