Removing strange smells, especially from older homnes can be challenging. It just takes some elbow grease and a little money.
Old houses or a home where elderly folks have lived, can have some strange odors. The method of removing them can vary, depending on the severity of the smells.
We will start with the easy stuff and work from there. A VERY thorough cleaning would be the first step. Use Bleach in the kitchen and bathrooms. Pull out appliances and scrub EVERYTHING down. A new toilet could be necessary to remove musty smells or assuming it's an older toilet. Although It's not necessary... newer toilets are MUCH more efficient. In the long run you will save money by using less water. BRAND NEW toilets range from $40.00 to $400.00+. While you are at it, if the floor is vinyl or carpet, now would be a good time to replace it. If you are low on money, peel and stick tiles can run less than $100.00 for an "Average Bathroom". Otherwise a GOOD cleaning should eliminate odors.
Moving on, the carpet in the home will be permeated with odors. It will need to be cleaned and treated with deodorizer. If there was a pet or it is older carpeting, the best bet might be tearing it out and replacing it or refinishing any hardwoods that might be under the carpet. Walls should be painted if they need it. Remember that they can hold odors too. A good primer like KILZ can eliminate odors and stains before applying fresh paint. Finally, air ducts and hvac filters can hold odors. Changing the filters and installing "scented" filter strips can really help. If it's not enough or if the house is old, you should have the vents cleaned. Most companies charge around $100.00 or so for 1000 SqFt.
If the above cleaning methods didn't work and replacing the carpet and paint didn't get rid of the smells, it's time for the "Extreme" methods of odor removal.
If you live in the home, you might have to do a little at a time. If the house is recently vacant, your job will be MUCH easier. With an old house, you will likely need to start tearing out walls and cabinets. If the house is historical, you should consider NOT tearing everything out, but pursuing other means. Historical homes or buildings that are significant should be restored properly.
Tearing out the walls and fixtures can get expensive, so plan ahead. If it's lathe and plaster, you will have 5-10 pick up truck loads to take to the dump. A construction dumpster is another option, but can get expensive. Once the interior walls are bare to the studs, you can hire or do the sheetrock yourself. While you are at it, wiring updates, plumbing and changing room sizes and shapes is a LOT easier. While this seems extreme, if you inherited a house from an elderly relative it can be worth it. If you purchased an older home and it has funny odors or elderly decay, it might be time to decide if you want to remodel, or live with it. Ultimately, your smell and all of the smelly deodorizer will replace the unpleasant smells. Just know that it can take years! Cigarette smoke and the smell of decaying remains can be nearly impossible to remove.
A good cleaning, replacing all of the carpets, bathroom and kitchen flooring, cleaning the vents and KILZ primer with fresh paint SHOULD remove almost ANY undesirable odors. A De-ionizer can help with cigarette smoke and pet smells. Also, remember that sometimes OLD houses JUST smell. If they are over 70 years old, they can have old lumber smells, dead animal smells, musty/ mildew, and just stuffy elderly people smells. Do what you can to remove the smells and try to cover up other odors with paint, sealant or deodorizer. Musty and mildew smells can be eliminated by fixing a leak or moisture source and utilizing a De-Humidifier or DAMP-RID type desiccants. Good Luck!