The sun can be north of you anywhere in the northern hemisphere, near sunrise and sunset.
For all of the following, I presume you are in the northern hemisphere. At the equinoxes, the sun rises at due east and sets at due west anywhere in the world, except exactly at the poles where due east has no meaning. Between the March and September equinoxes, the sun's rise and set points are north of due east and due west. From September to March, the rise and set points are south of east and west.
Why is this so? Try a thought experiment. You are standing somewhere in the northern hemisphere, on the surface of the earth. There is a local horizon plane, containing your viewpoint, and perpendicular to the local vertical. You can imagine this plane extending out to infinity. Your plane has a line on it which is through your viewpoint and exactly perpendicular to the earth's pole, even though the pole is at an angle to your plane. This perpendicular line runs from due east to due west and can also be considered to extend out to infinity. A line perpendicular to this one in your plane through your position runs from due north to due south.
You are standing on the surface of the Earth, but the sun, planets and stars are all nailed to the inside of the celestial sphere, which as everyone knows, is infinitely far away. This sphere is centered on the center of the Earth, but since it is so big, it doesn't matter and you can consider it centered on your viewpoint. Also as everyone knows, the sky rotates, not the earth.
On the March equinox, the sun is on the celestial equator, the circle on the celestial sphere where it intersects the projection of the earth's equatorial plane out into space. The declination (celestial equivalent to latitude) is zero. Now your east-west line is parallel to the equatorial plane, and the celestial sphere is so big that your actual distance from the equator is insignificant and your east-west line pierces the celestial sphere at its equator. Since the sun's declination doesn't change much in the course of a day, it traces a circle around the celestial sphere and hits your east-west line twice, once at sunrise when it crosses from below to above your plane, and once at sunset when it goes the other way. Therefore it rises and sets at due east and west.
Three months later at the June solstice, the sun has a declination of 23.5deg. It describes a circle, no longer on the equator, but a good deal north of it. Since it is no longer on the equator, it no longer passes through your east-west line. In fact, it crosses through your horizon plane a good deal north of the east-west line, so the sun rises north of east and sets north of west. As it happens, the sun will traverse more than 180deg of arc when it does this, and therefore stay up longer than 12 hours, which is why the days are longer in the summer.
Six months later at the December solstice, the sun is a good deal south of the celestial equator, so it crosses your plane south of east and west. The sun traverses less than 180deg, and therefore is up for less than 12 hours.
The exact details depend on your latitude, and it can happen that if you are near the pole, your horizon plane never crosses the Sun's path, and therefore the sun never rises or sets. This is inside the arctic/antarctic circles.
If you are between the equator and the tropic of cancer (northern tropic circle) it can happen that the sun stays north of you all day long, and at noon the shadows will point due south instead of due north.
Remember in this diagram that the celestial sphere is so much bigger than the Earth that there is no difference between the horizon plane going through the center of the earth and sphere, and the one going through a point on the surface of the earth, which is still considered to go through the center of the sphere. In the bottom diagram, the Earth is drawn small, but should be point-like at this scale.