Botanically speaking, a tomato is a fruit because it has seeds. A fruit develops from the ovary of a plant and contains at least one seed inside it. Many fruits contain multiple seeds, including the tomato.
A vegetable is an edible part of a plant such as the roots, stems and leaves and does not have seeds. Tomatoes are commonly considered vegetables because they are considered savory instead of sweet, and they are often used as vegetables by chefs in the main part of the meal.
Some other examples of fruits generally thought of as vegetables are squash, peapods, cucumbers, green beans and peppers.