Which types of skin cancers are caused by sunlight? Are the non sunlight caused cancers caused by something else or just bad luck?

Most skin cancers. Sun exposure is thought to be the main cause of all types of skin cancer. The most common type- basal cell cancer- is usually caused by years of sun exposure. Others, such a melanoma, may be related to occasional sun burns. There are some rare inherited diseases which can lead to skin cancers. So, wear a hat and use sunscreens generously!
All. Most skin cancers are caused by uv radiation from the sun. But course other factors come into play, such as environmental and genetics.
All of them. All 3 types of skin cancer, basal cell, squamous cell, & melanoma, are increased in people with lots of sun exposure. Other risk factors for include family history.