There are four directions to rally point, up, down, left, and right. Keep in mind that the castle fight map goes sideways, so towards your opponents is either left or right. Now, pick one of those that you want the unit to go. For each direction, there are two different ways to place the rally point. Consider rallying right. You can rally from the top right corner directly to the right, or from the bottom right corner also directly to the right. All rally points should be in a straight line from a corner of the building, not in the middle, but which corner is correct?
The answer is very simple: start in the middle of the side you are rallying to, between the two corners, and go *clockwise*. On the right side, clockwise will take us to the bottom right corner. Rally directly to the right of the bottom right corner.
For the top, rally straight up from the right side.
For left, rally straight left from the top corner.
For bottom, rally straight down from the left side.
Q: How far away should i put the rally point?
A: 80% of the length of a building works.
Q: What if I want to rally left, but the left side is blocked by units?
A: It won't work. Design your farms to avoid this problem. Know which area of the farm will fill up first, and therefore which buildings will no longer be possible to rally into the farm. Then put buildings there that you didn't want to rally into the farm anyway, like obelisk of light.
Q: What if another building is blocking *half* of the left side? Say the top half of the left is blocked.
A: The bottom corner of the left stays the same. The top corner of the left is blocked, so use the first open space towards the top, which is the middle and treat that as the top left corner for rallying left.
Q: How did you figure this out?
A: There's only two places to consider putting the rally point per side. Just try both and see which works. The original rule I worked out was: go in a circle *counter-clockwise* and when you first hit the open area you want to rally into, rally there. You could equally well go clockwise and rally to the last part of the open area where you want the units to go.