Accurately modeling the relationship between socioeconomic factors such as GDP, population size, and life expectancy is vital for evidence-based policymaking. This study presents a machine learning framework using stacking regressors to predict life expectancy while capturing the complex, non-linear interactions of GDP and population dynamics over time. The methodology involves comprehensive data preprocessing, parameter tuning via GridSearchCV, and rigorous evaluation using cross-validation to ensure reliability. The proposed approach provides interpretable insights into how variations in GDP and population size influence life expectancy trends, offering valuable guidance for economic and demographic planning. Experimental results highlight the effectiveness of the stacking model, achieving a Mean Squared Error (MSE) of 0.295 and a Mean Absolute Error (MAE) of 0.443, outperforming traditional regression and tree-based methods. This framework offers a robust solution for researchers and policymakers aiming to understand and predict long-term socioeconomic outcomes.