We ran into a similar situation in the duplex we purchased. The floors were all hardwood so we did not have to deal with removing carpets, but if you have carpets I would recommend removing them. For the walls and ceiling before we painted we used TSP cleaner you should be able to find it at Home Depot, it is very strong so you should plan on wearing thick rubber gloves. Then we primed with Kilz just be cautious if it is the oil based one it will have a very strong odor, after priming we painted the entire unit. Also leave the windows open as often as possible, I understand it is a tough time of year to do that here in Massachusetts. Lastly the bathroom will probably be the toughest to eliminate the smoke odor, since the bathroom steams up while using the shower the smoke really locks into the walls. We gutted our bathroom out completely not because of the smoke just because it needed it. I would recommend the TSP in the bathroom as well and just keep changing the water often. Good Luck hopefully this helped, and make sure when you go to rent it out it states NO SMOKING in the lease that is written up.