In almost all cases, I do not recommend having showings of your home before it is listed for sale. But, as with most things in life, there are some exceptions.
Here are some of the reasons NOT to allow showings before your house is listed for sale...
[1] Buyers who view your home before you list it for sale are not likely to feel much urgency to make a decision about an offer. They don't have any competition, after all, so they can just think about it. Once your house is on the market and lots of buyers know it is for sale, each and every buyer who views your home will feel the urgency of making a decision about whether to make an offer. That felt buyer urgency works in your favor when selling your home - and you miss out on it for any individual buyers who view your home before it is on the market.
[2] If you receive an offer from a buyer who views your home before it is listed for sale you will be considering that offer without the market context of how much interest your house would have if listed for sale and how many offers you might have if it were listed for sale. You might list your home and have 2 showings and 1 offer, or you might have 20 showings and 10 offers... but you won't know when you are considering the singular offer from the buyer who viewed your home before it hit the market.
[3] Since you only have one offer, you are at least somewhat likely to sell your house for less favorable terms than if you had listed it for sale. Certainly, you might list it for sale and only have one offer - but if there were multiple offers when you listed it for sale, you could then select from multiple offers with different prices (possibly escalated), different contingencies and from buyers with different financial capabilities. Letting a buyer see your house before it is listed for sale opens the door to having only one offer to consider, which might not result in the best possible terms for you.
Here are some of the reasons you might ALLOW showings before your house is listed for sale...
[1] It's a lot of work to get your house ready for photos and showings, and even more so if you have kids or pets. ;-) Some sellers would gladly show their house once, before it hits the market, and have it under contract shortly thereafter, rather than going through the process of completely preparing the house for photos and showings. Certainly, you'll still want your house to look good for that one buyers... but preparing for their showing likely won't be as intensive as preparing for fully putting your house on the market.
[2] Some sellers have a friend, neighbor or co-worker that has already expressed interest in buying their house and they (the seller) would be delighted to sell the house to that person or persons. If you want to give some known potential buyer a leg up in the buying process, letting them see your house before it is listed for sale, and potentially make an offer without having to compete with other buyers, then you can certainly choose to do so. It does create the downsides described above, but you might still elect to go this route because of those relationships.
[3] I tried to come up with a third reason. I didn't. Feel free to send me your suggestions. ;-)
As you can see, there are plenty of reasons to allow or disallow showings of your house before it is listed for sale. Generally speaking, I don't recommend it - but there can certainly be situations where it makes sense to pursue that path.