If you’re trying to build a house north of an old pine forrest (∼50m tall trees). How far north must you be from the edge of the forrest in order to ensure that you see at least a bit of the Sun even during the winter solstice?

Well, if it is a pine forest I suppose you are somewhere around 42 degrees north latitude

Take a guess at 22 degrees south declination at Dec 22

add your latitude to that for example if 42 degrees north latitude the sun is 42 + 22 = 62 degrees below straight up at noon on the solstice

top of tree also 62 below straight up which is 90-62 = 28 above horizon at noon.
tan 28 = 50/d