Earth- (proper noun) this means that you are referring to Earth specially as a plant and proper nouns are always capitalized. For example, 'I live on Earth'. Just like if you were to say, 'I live in Japan', you'd capitalize "Japan"
earth- (common noun) this refers to the ground or soil. Example 'It is necessary to dig up the earth properly in order to plant carrots'.
Lowercase "earth" ,however, can also be used in sayings such as, "what on earth!"