This paper introduces a dynamic three-stage task scheduling algorithm for cloud computing that aims to optimize resource utilization and minimize task waiting times. The algorithm conducts task classification, prioritizes tasks based on deadlines, and dynamically pairs tasks with virtual machines (VMs) for efficient execution. Simulation results demonstrate its superior performance compared to traditional algorithms in terms of average waiting time, makespan, and VM utilization.