What you are seeing here isn’t lightning, it’s static electricity on the window of a plane. It’s called Saint Elmo’s Fire. It occurs when the atmosphere becomes charged and an electrical potential strong enough to cause a discharge (plasma) is created between an object and the air around it. This can happen to an aircraft flying through heavily charged skies.