the term means “good luck, give a good performance"
If actors were not performing, they had to stay behind the “leg line,” which also meant they wouldn't get paid. If you were to tell the actor to “break a leg,” you were wishing them the opportunity to perform and get paid. The sentiment remains the same today; the term means “good luck, give a good performance.”