If you are using a metal type chimney the two foot rule is ok but you may have to support it if there is many feet outside above your roof to get the needed height. This support can be made from emt type tubing and anchored to your roof or building or buy it from the Chimney manufacturer If you are using a mason type set up 2 or 3 feet is great. The height above your roof ridge is to prevent a down draft on a windy day as the wind blows over the roof ridge.
The min, is two feet above the peak but I would put it three feet you will get a better draw from it.
It depends on if you want your house covered in smoke stains or the possible accidental fire from the chimney being to short.here is a site that shows a code and information on chimneys. If you are talking a fake gas fire place it can be vented out the side wall of the house and does not need a chimney. Www.solidflue.com/concerns.htm homebuying.about.com/cs/gas logs/a/vented_gas_logs.htm
It needs to be about 5 Feet above the base or level with the top of the peak of the roof.