The lungs are located in the thoracic cavity. The thoracic cavity is a space in the chest that contains the lungs, heart, and other organs. It is separated from the abdominal cavity by the diaphragm, a muscular sheet that contracts and relaxes to help with breathing.
The pelvic cavity is a space in the lower abdomen that contains the bladder, uterus, and rectum.
The abdominal cavity is a large space in the abdomen that contains the stomach, intestines, liver, kidneys, and other organs.
The body cavity is a general term for any space in the body that contains organs.