The microgrid voltage and frequency are strongly affected by active and reactive load fluctuations. Load change in microgrid may result in the lack of balance among generation and consumption and as result change in output voltage and frequency. If load change is great enough, distribution generation cannot stabilize the microgrid. The main objective of this article is to control the distribution of active and reactive power related to an inverter-based distributed generation (DG) in the microgrid using intelligent methods. In this study, frequency and voltage of an active generator connected to the microgrid is also controlled with applying adaptive the fuzzy sliding mode control (AFSMC) and the droop control methods. To solve the problems related to design of the sliding mode controller, a compensator control system is suggested. A rule based on the Lyapunov stability theory is also introduced to ensure the stability of closed loop system. The provided simulation results by MATLAB/SIMULINIK software show the effectiveness of suggested method to regulate active and reactive power and to control voltage and frequency of the microgrid.