Earned runs are any runs scored without an error being committed to let them cross the plate, or , get on base in the first place and before three outs would have occurred had there not been any errors.
It may be easier to say that an unearned run is one that would not have scored except for errors and then say an earned run is one that is not unearned.