In this report, an analytic model to predict phase transitions of confined fluids in nano systems is presented and it is used to predict the behavior of the confined fluid in nanotubes and nanoslits. In our approach besides including a third degree of freedom due to wall effect to define the state of the system, the tensorial character for pressure is considered. Using the perturbation theory of statistical mechanics it is shown that the van der Waals equation of state is equally valid for small as well as large systems. The model proposed is shown to predict the liquid-vapor phase transition as well as the critical point in any size confined fluid systems. It is also shown that the critical temperature increases with the size of the nano system and finally it reaches the macroscopic critical temperature value as the diameter of the nanotube (or width of the nanoslit) approaches infinity. The proposed model can also demonstrate the existence of the local density and phase fragmentations during phase transitions in a confined nano system.