To achieve what you want, I think you just need to resample the data monthly and apply a rolling window of 2 to calculate the mean and standard deviation. Try with the following code:
rolling_mean = df.resample('M').mean().rolling(window=2).mean()
rolling_std = df.resample('M').mean().rolling(window=2).std()