。
I took shelter from the rain under a tree.
Literal
Tree-shade [at-で] rain-shelter [object-を] did.
雨宿り ('rain shelter') is a beautiful compound noun from 雨 ('rain') + 宿り ('lodging, staying'), meaning specifically 'sheltering briefly from rain.' It pairs with する as a suru-phrase: 雨宿りをする ('to take shelter from rain'). で here is locative — 'at the tree-shade.'