It is a combination of interior size of gourd or nest box and the size of the opening. If the opening is too big, you can allow unwanted birds to use the nest box.
I wanted wrens or chickadees to use my new bird house this Spring. The whole diameter was 1 1/8". Small enough to deny entrance to House Sparrows, Cardinals, Starlings, Blue Jays and others. But if I had a hole 1 3/4" wide, all of those birds would come into play.
They are looking for a nesting site. They do not choose a gourd over a wooden or plastic house. They are not capable of realizing the difference in material.
I had 2 House Wren families this year in my new box. I think that the parents raised 4 babies total. The wrens just loved it and we're defending it against other birds!