Basically common sense rules. If the rifle looks like its been through a swamp or two then it probably has.
Things to check: Barrel/bore for rust and or pitting. Use a bore light or shine a flashlight down the barrel to help here. Look at he overall condition of the metal. Is there any rust at all? If so it probably has not been very well taken care of. If at all possible run a patch down the bore to clean any residue check the bore after doing this.
Check all the moving parts, whatever they are. On a bolt action rifle this would be the bolt/locking lugs on the bolt. If there is a lot of metal wear evident then the rifle has probably seen some use.
Be sure to check the safety, ensuring it is functional. Check any accessories that come with it such as a scope or optics. Look for broken lenses, make sure the adjustment knobs turn, look for water or moisture inside the tube. Lastly check the scope rings and bases for tightness and servicability. Not to be overlooked are all the screws. Look for "buggered" screw slots. This may not show any problems with the rifle. But it would indicate that someone without proper screwdrivers took the rifle apart - who knows what else they did or did not do.
HTH,
Rob