Fruit has a botanical defintion that is different from how the term is commonly used. To a botanist, fruit is any container of a flowering plant that contains fertilized seeds.
@LostInParadise is correct, squash and gourds are fruits, and we just lump together with other vegetables in the market.
In a sense that’s correct because in a broad term “vegetable” is some part of a plant – but in that same sense all the “fruit” we know of are also vegetables.
In the technical sense, a fruit is the product of flower fertilization that leads to a fruit body, with seeds, that is usually the primary way the plant propagates.
It looks like English might not be your native language. Part of the problem might be our language itself. I don’t know, but perhaps other languages aren’t so confusing with their terms.