Not just any type of wood can be used on an outdoor fence. Regular whitewood fences like spruce, pine and fir are not designed to be outside as they easily rot when exposed to the elements. Even when you stain or repaint, these types of fences can only last from 7 to 12 years.
We recommend using cedar fence wood. These types of wood have a natural resistance to rot as well as a defense against termites. Unstained, they can last from 15-20 years. If prestained and re-stained every 5-7 years, they can last up to 40 years. Treated pine is another good option for a white wood fence. It is already resistant to rot. You can also paint it or stain it to keep it from warping.
A pre-stained wood fence can last longer. Pre-staining gets the wood dried out to 12% moisture content. It can then be stained all over, including the edges before it is used. Staining it later means leaving spots that are unstained which would cause the wood to rot.