I have a very basic question regarding modelling when testing for interaction for finding heterogeneity in treatment effects in subgroups.

As far as I understand the general specification of the model where a single single subgroup is considered will be

Treat+Subgroup+Subgroup x Treat

However when analysing multiple subgroups what would be the correct way to specify the model

Treat+Subgroup1+Subgroup2+Subgroup1 x Treat

or

Treat+Subgroup1+Subgroup2+Subgroup1 x Treat+Subgroup2 x Treat