There are some howtos accessible via Google and there is the wiki article which explains how to setup a master/slave configuration:
There are different setups possible: Which router are you using as a capsman? I would suggest to setup the configuration in capsman-forwarding mode since you can easily build datapaths with bridges and vlans on the capsman router thus having only "dumb" access points getting their configuration from the capsman and forwarding all traffic via a tunnel.
Things you should think about when setting this up:
You would first create one master configuration for 2,4 and one for the 5ghz interfaces. (Best would be to have your internal network as master since its consistent between all access points).
Then you would add two slave configurations - one for building #1 and the other for building #2 as guest networks.
Provisioning rule can now be matched either by the clients identity (on Client /sys identity) AND hw-supported-modes (to distinguish between 2,4 and 5ghz master config) or you can match the radios by their mac-addresses (thats what we do, but that produces more provisioning rules - 2 * amount of caps).
https://wiki.mikrotik.com/wiki/Manual:C ... ovisioning