A general approach. It doesn't just answer the question in the OP ("do this"), instead it explains the mechanics in general so it answers the question as byproduct.
- every unloading station should have a train unloading
- every loading station should have a train loading
- empty trains should leave an unloading station immediately
- every station has 1 or more slots (colloquial for "train limit").
- we have a number of loading stations and a number of unloading stations. This is the number of stations of each type.
- we have a number of loading slots and a number of unloading slots. The number of slots is the sum of the train limits of all stations of one kind.
- basic schedule: 1) loading station - wait for full; 2) unloading station - wait for empty
- employ the maximum possible number of trains
Let's have a factory with 4 iron ore unloading stations. How many trains, slots, waiting areas, ore loading stations do we need?
As start, we set a fixed train limit of 1 to every loading station. Unloading stations can have a circuit controlled train limit of 0 or 1, depending on the free space of the unloading station chests: 0 if the free space is less than the content of one train, 1 otherwise. But that's not required. It postpones dispatching full trains until a train is actually required.
Let's look at trains leaving their unloading station.
A train can only leave its unloading station, if there are free loading slots.
So we need at least as many free loading slots as we have unloading stations - in case every train gets empty at the same time.
Upper limit:
We must not have more trains than loading slots. [A]
Lower limit:
We want a train at every unloading station in case demand is high, so
we need at least as many trains as we have unloading stations [B]
So according to A and B, we need at least as many trains as unloading stations, but not more than the number of loading slots.
Let's assume we need 3 ore mines to satisfy the demand of one unloading station.
So we build 4*3=12 ore mines. This results in 12 loading slots.
According to A, the upper limit for trains is 12. According to B, the lower limit for trains is 4.
So we employ 12 trains to have as many loading stations occupied as possible.
What happens if every unloading station is full, and we set every train limit to 0 with circuits, so the number of unloading slots became 0?
After some time, all 12 trains are full and wait at their ore mines for an unloading slot becoming available. If it becomes available one train will start, freeing its slot at the loading station. If it becomes empty, it can return to its loading station, because that slot became available when it left.
This setup will work fine until the distance between loading and unloading stations becomes so high that the time required to travel from a loading station to an unloading station is longer than the train load actually lasts, so trains are unable to deliver enough to satisfy demand. Keep in mind: if an unloading slot becomes available, one train will start from an ore mine far away. If it needs more time to travel to the unloading station than the previous train unload lasts, the station chests will run empty.
In this case, we need more than 1 unloading slot per station, so we can have 1 train currently being unloaded and 1 or more trains currently driving to the station. We can build a longer track in front of every unloading station, so there is enough space for an additional train not clogging the main track. Now we can toggle the train limit of unloading stations between 1 and 2 via circuit (1 if the station is full, 2 if the station has space for at least 1 train).
If you do this, you might observe full trains waiting in front of full stations while another station is running empty.
So we need to clarify B:
We want a train at every unloading station in case demand is high, so
we need at least as many trains as we have unloading slots [B2]
So whenever we check B, we actually need to check B2 (count slots, not only stations)
Let's check:
4 unloading stations with 2 unloading slots = global 8 unloading slots.
This is below our train limit of 12 and should be enough, but in case all unloading slots are occupied, we have 8 trains dealing with unload and only 4 trains dealing with loading. So we might need to increase the number of trains to have full trains available in case one of the unloading slots becomes available again.
To be able to increase the number of trains, we need to increase the number of loading slots.
To increase the number of loading slots we can either add new ore mines, or we can add a longer track in front of the ore stations, similar to what we did for the unloading station, and increase the fixed station limit to 2 where we added this longer track. If we add new mines or just waiting space depends on supply and demand: if our demand can be satisfied by the existing mines, we only need to add a longer track. Otherwise we need to add more mines.
Finally, there is an alternative approach to add 1 additional track in front of each station. If there are multiple stations of the same type directly next to each other, which is common for unloading stations, you can share these tracks across stations. Create multiple parallel tracks ("stacker") that exit to these multiple stations, with proper chain signaling, so in case all stations are full the trains wait in the stacker, and if one slot becomes available, one of the waiting trains will reserve the track and proceed to that station.
If you use a stacker that serves multiple stations, the sum of the train limits of the individual stations is the sum of the number of stations plus the number of lanes in the stacker. So if you have 2 stations and want an overall train limit of 6, the stacker needs 6-2=4 lanes and each station needs a limit of 3. This way, if everything is full, 1 train is standing at each station and 4 trains are in the stacker.
Ok, there is a second finally.
Sometimes, the distance is so large, these waiting areas made of stackers won't work. Or the stations are so distributed, it makes no sense to make shared stackers. You can make stackers for one station of course, but that needs quite some space.
But it can happen your base grows so large, this direct approach of stackers directly in front of stations isn't feasible. In this case, you can create what I assume is called a depot. A depot is a lone station without loading/unloading functionality but with a stacker. Its train limit equals the number of lanes it has. You insert a depot station between loading and unloading, i. e. you can have a depot for empty trains in the schedule before the loading station, and a different depot for full trains before the unloading station. Its schedule entry doesn't have any waiting condition.
The maximum amount of trains changes with the usage of depots.
A changes, if you're using a depot for empty trains. It's currently "we must not have more trains than loading slots. [A]".
Since now empty trains can also wait in a depot, it's now:
We must not have more trains than empty train depot slots plus loading slots. [A2]
So we can use more trains!
If you're using a depot for full trains, neither A nor B changes. Its function is to uncouple waiting areas/stackers in front of stations from each other and to bring full trains near the base without actually assigning them to a specific stacker/unloading station.
Sorry for the long writeup... I somehow felt the urge to cover all of my observations.
ps.
Don't ever use the "activate/disable station" functionality with circuits. If a station is disabled while a train is driving to it, and there is currently no other station with the same name and a train limit above 0, this train stops right in the middle of nowhere, clogging the tracks. Always use train limits instead, which is the only possible operation in the upcoming Factorio 2.0, by the way.