assuming the garage will be one of the long sides (otherwise lots of extra fencing will be used), then if the long side is x, the short side will be 50/x.
So, the amount of fence, f, is
f(x) = x + 2(50/x) = x + 100/x
df/dx = 1 - 100/x^2
we want minimum fence, so df/dx = 0:
x = 10
So, the pen is 10x5, using 20 ft of fence.
Note that the square is the figure of maximum area using a given perimeter. Or, conversely, a square haas the minimum perimeter to enclose a given area.
Your pen is just two squares, where each encloses half the area. The garage wall helps out here.