What causes faintness? Not exercising enough?

Complex answer. If this has happened more than once you need to see your doctor to determine what is going on and the cause.