Subterranean termites and dry wood termites are both attracted to light. If you live in an area where termites are known to swarm then you have to be careful about exposing any light from your home to the outside environment around it. When people have an infestation of termites in or around their home, they usually notice it at nighttime because this is when termites start swarming the most. They may also swarm during the daylight hours too but it will be harder to spot them because they could be virtually anywhere around your home. The daylight from the outdoors attracts them to pretty much any location. But at nighttime, the lights around your home will attract swarmers and make them very noticeable because those are the only areas at night which give off light. This makes termites want to get closer to that light source since it is warm and termites are attracted to warmth. If there is rain or humidity outside then this will make the swarming even worse if there is light around.
The winged swarmers are the termites you have to watch out for the most. After a colony has been established, winged female and male termites swarm out of it in massive numbers. This is the time when they are highly attracted to light so you will often see them flying around areas of your home where light is produced. Eventually, the winged termites will land back on the ground and lose their wings. At this point, they start to mate and form brand new colonies. After more of them are produced, they will begin swarming in even greater numbers towards areas that have a lot of light. This is why you need to limit the amount of light around your home.
When termites are spotted at nighttime, they will likely be found near the lights, doors, and windows of your home. If they are worker termites without wings then your light sources need to be as high up from the ground as possible. Any windows with light coming from them should have their curtains closed in order to block the light from being exposed outside. If you have porch or backyard lights then they should not be left on for extended periods of time. Only turn them on while you are outside, and then turn them off when you go back inside. As for your indoor lighting, try not to leave the bigger lights on for too long. If you have to, leave only the smaller lights on that are away from any windows or doors. This will be the best way in preventing termites from infesting those areas of your home.