This paper presents the design and validation of a Global Navigation Satellite System (GNSS)-based attitude determination algorithm tailored for very small spacecraft, such as the Seoul National University GNSS Laboratory Satellite-III (SNUGLITE-III) CubeSat. SNUGLITE-III consists of two satellites developed in a standard 3U CubeSat configuration. These CubeSats aim to perform formation flying, collect GNSS Radio Occultation (GNSS-RO) data, and develop a precise orbit control system for rendezvous docking. To achieve these objectives, a robust and precise attitude determination and control system (ADCS) is essential. The ADCS of SNUGLITE-III comprises two modules: the primary system uses a star tracker for high precision attitude determination, while the secondary system incorporates Micro Electro Mechanical Systems sensors, including an Inertial Measurement Unit, sun sensor, magnetometer, and a GNSS receiver to act as a backup. This backup system is especially important during high angular velocity conditions, such as detumbling, or when the star tracker is unavailable. Although highly effective, GNSS-based attitude determination faces several challenges in CubeSats due to their limited space, which restricts antenna placement and reduces the number of visible satellites. Conventional GNSS-based methods rely on multiple antennas aligned in similar directions to maximize the number of visible satellites. However, CubeSats, especially those smaller than 3U, cannot easily accommodate multiple antennas with adequate separation. To overcome these limitations, we propose an algorithm that resolves GNSS carrier phase integer ambiguities every second, even with limited satellite visibility. The method utilizes the least squares ambiguity search technique (LSAST), combined with CubeSat-specific constraints such as baseline length and antenna arrangement, to reduce the search space and computational load. While LAMBDA, the most widely used method for integer ambiguity resolution, provides high accuracy, it requires significant computational resources, making it less suitable for CubeSats with limited onboard processing power. Our approach leverages the reduced computational requirements of LSAST and additional constraints to maintain reliable performance in real-time operations. Simulation analyses were conducted to evaluate the algorithm’s performance under various conditions, including the number of visible satellites. The results demonstrate that the proposed method successfully resolves integer ambiguities and performs attitude determination every second, even with the limited resources available in CubeSats. This validates the effectiveness of the algorithm for real-time GNSS-based attitude determination in CubeSat missions like SNUGLITE-III, ensuring accurate orbit control and mission success.