If you look at the sun with your eyes closed you won't be able to see anything or the sun so it would not hurt your eyes if you closed your eyes and then looked up towards the sun because your eyelids would protect your eyes from the suns rays.
However if you do want to look at the sun try wearing a welding helmet that is used to weld with as the welding helmet blocks the harmful UV rays from the welder which can cause you to go blind or burn your eyes.
So you can use the welding mask or welding helmet with the lens in to block the UV rays from the sun as I've done it myself.
I've worn a welding helmet to look up directly at the sun and it never hurt my eyes.