The police cannot search your home without a warrant whether you're home or not.
If you're not home and the police have a warrant then yes they can legally enter your home while you're not there and perform the search of the home as long as they have a warrant signed by a judge.
Police do this all the time when someone has been arrested and are in jail, then the judge gives the police a search warrant so that the police can search your home for evidence or things that you might have used while committing a crime.
An example would be James Holmes who shot up a movie Theater, they searched his apartment while he was in jail and discovered booby traps and all sorts of other stuff that could be used in a crime.
So no you don't have to be home for police to legally search your home as long as the police have a warrant to enter the home or perform the search.