Yes, the AC unit has to be next to the house. A common rule of thumb is that each side of your air conditioner should have at least 12 inches or one foot of clearance. Your air conditioner's manufacturing company may have their particular set of specifications, but it's usually between 12 and 24 inches. In ideal circumstances, you must place the air conditioner on the north or east side of your property, where it will be naturally shaded from the sun during the hottest portion of the day.