If we want to explain the influence of money circulation (M) on national output (GDP), it is obviously necessary to set GDP as the explained variable, that is, the Y variable.
If we want to explain the influence of national output on monetary policy, we should set m as the explained variable.
If your model has only two variables, GDP and M, then I suggest that you don't simply decide who is the explanatory variable and who is the explained variable, because both are time series data, so it involves co-integration model, so you should adopt EG two-step method or other time series models instead of simply making regression. Otherwise, there will be false regression.