The present study focuses on the deformation of neutron-rich nuclei near the neutron drip line. The nuclei of interest include 28O, 42Si, 58Ca, 80Ni, 100Kr, 122Ru, 152Ba, 166Sm, and 176Er. The relativistic Hartree - Bogoliubov (RHB) approach with effective density-dependent point coupling is utilized to investigate the triaxial deformation, and Skyrme - Hartree - Fock + Bardeen - Cooper - Schrieffer is used to analyze the axial deformation. The study aimed to understand the interplay between nuclear forces, particle interactions, and shell structure to gain insights into the unique behavior of neutron-rich nuclei. Despite these nuclei containing magic numbers, their shapes are still affected by the nucleons' collective behavior and energy levels. As the number of neutrons increases, the shape smoothly transitions from spherical to triaxial and then to prolate. The axial deformation analysis confirmed the results of the triaxial deformation analysis using the RHB method. An imbalance in the number of protons and neutrons can affect pairing energy, where extra neutrons can reduce overall pairing energy, and protons can disrupt the nucleon pairing due to stronger Coulomb repulsion between them.