Nutrient density refers to foods that have an abundance of "good nutrition" such as vitamins, minerals, and proteins, carbohydrates and fats. These are all needed for optimal health and need to be consumed daily.
Energy density refers to foods that provide an abundance of calories (energy). Usually this energy comes in the form of carbohydrates, and most often as simple sugars. Simple sugars would allow the body to utilize the energy sooner than complex carbohydrates because less digestion is needed to absorb them.
In making healthy food choices, for most people, the aim would be for more nutrient dense foods that have fewer calories, or are less energy dense. For example, a better choice of snack would be a fresh apple that only has 40 calories, but is packed with vitamins and minerals to go along with the calories. Additionally, this is a complex carbohydrate and will take some time to digest giving its energy over a longer space of time and allowing the body to use the energy rather than having to store it for use later. A poor snack choice would be a energy dense snack, such as a doughnut, which would provide at least 3 times the calories, and very few vitamins or minerals. The calories would be in the form of more simple carbohydrates and sugars that would be immediately available for the body's use. However, unless the body is engaging in strenuous physical activity shortly after consuming the doughnut, most of this would be stored for use later. Much of this storage turns into fat.