We took shelter in a nearby barn to escape the storm.
Literal
Storm [object-を] avoiding nearby barn [to-に] fled-into.
嵐を避けて (avoiding the storm) uses 避ける (to avoid). 逃げ込む (to flee into/take shelter) is a compound verb: 逃げる (flee) + 込む (into). 納屋 (barn) is a rural vocabulary word.