In a drug investigation, as with other kinds of investigations, there are three ways that a police officer may enter your home: (1) with your permission, (2) with a warrant, or (3) in certain emergencies. These rules generally only apply to entering your house, not on to your property. There exists at law an implied consent for anyone, including the police, to walk on to your property for the purpose of talking to you at your front door. As long as the police have a legitimate purpose to be on your property, including to talk to you, than they are allowed to walk up to your door. You, however, are not required to open the door to a police officer, nor are you required to speak to them at your door.
Police can search your house with your permission. If they ask for permission to enter, you do not need to give it. You can also remove the permission after you've given. If you are unsure whether to grant permission or not, you should contact a lawyer and ask for advice.
Police can enter your house to search with a search warrant. A search warrant is a document that the police obtain from a Judge or a Justice of the Peace after reviewing an Information to Obtain (ITO) provided by the police that lays out the grounds for why the need to search. If the police have a search warrant, you have to let them search the place. You are allowed to see the search warrant, and you should make sure that the address and date are correct. Attempting to interfere with the police searching your house when they have a search warrant may result in you being charged with obstructing police.
Police are allowed to enter your house in a few emergency situations. The police can follow someone in to a house if that person has committed a criminal offence and the police are in pursuit. They can enter your house if they have reason someone is going to injure or harm someone else, for example if a 911 call was made by someone inside the house indicating they were being attacked. Lastly, they can enter your house in order to provide emergency first aid to someone inside. They are allowed entry into your house to do the above, but they are not entitled to go searching. That being said, if they see anything illegal or criminal in nature, such as drugs or guns, they can seize those.
The most common method used by police is to obtain a search warrant. Evidence obtained under a search warrant can be challenged in court if an arrest is made and there was evidence obtained under the search warrant.