According to well-established Supreme Court precedent, the police can enter and search a home if one of its occupants consents: The consent of a person with “common authority over the premises” justifies police entry if other occupants aren’t present to either consent or object. (United States v. Matlock, 415 U. S. 164 (1974); see How Police Get Permission to Conduct a Search.)
But the outcome is different if another occupant is home and objects to the search. If two occupants are present, one consents, and the other objects, the police usually can't search the residence. (Georgia v. Randolph, 547 U. S. 103 (2006).) Physical presence is key, however: The Supreme Court confirmed in 2014 that the objecting occupant must be present in order to prevent the search. (Fernandez v. California, 571 U.S. __ (2014).)
EXAMPLE 1: Wallace and Bodie share an apartment as roommates. The police, responding to a neighbor’s noise complaint, knock on the apartment door. Only Wallace is home. When he answers the door, the officers ask him whether they can come in and look around. He says yes. Even though Bodie isn’t around and hasn’t consented, the police are authorized to come in and have a look. (See Where the Police Can Look When Your Roommate Consents to a Search.)
EXAMPLE 2: The police knock on the door, and Wallace answers. This time, however, Bodie is home. He hears Wallace, who agrees to let the officers in, talking to them. He rushes to the door and tells the officers, “You can’t come in. I don’t consent to you entering my home.” The officers aren’t allowed to come into the apartment.
EXAMPLE 3: After speaking with Wallace and Bodie and determining that they can’t search the apartment, the officers leave. Two hours later, they come back and knock again. Bodie has stepped out from the apartment since they were last there, so Wallace is the only one home. He consents to the officers coming in and taking a look. Even though Bodie had been present and recently objected to a police search, the officers are now entitled to look around.