Estimating grid admittance is essential for assessing impedance stability and for designing adaptive controllers for distributed generation (DG) units. This paper proposes a new multivariable grid admittance identification algorithm that involves adaptive model order selection as an ancillary function within inverter-based DG controllers. Cross-coupling between d-and q-axis grid admittances necessitates multivariable estimation. To ensure persistence of excitation for grid admittance, sensitivity analysis is first employed in order to determine the injection of controlled voltage pulses by the DG. Grid admittance is then estimated from the processing of the extracted grid dynamics by the refined instrumental variable method for continuous-time system identification (RIVC) algorithm. The theoretical background underlying the RIVC algorithm is introduced, along with its integration within the proposed method for adaptive model order selection. Unlike nonparametric identification algorithms, the proposed RIVC algorithm provides a parametric multivariable model of grid admittance, which is essential for designing DG adaptive controllers. A hardware-in-the-loop application using OPAL-RT real-time simulators has been used to validate the proposed algorithm for both grid-connected and isolated active distribution networks.