Lightning-induced transient overvoltages pose a serious threat to modern electrical installations, particularly at main distribution panels where electrical energy is concentrated. Improper mitigation of these surges may lead to insulation breakdown, equipment damage, and system outages. This paper presents an analysis of the optimal placement of surge protective devices (SPDs) against lightning impulses at the main distribution panel using MATLAB-based simulation. Several protection scenarios are evaluated, including an unprotected condition and various SPD placement configurations. Lightning impulses are modeled using standard impulse waveforms, and system responses are analyzed in the time domain. Simulation results indicate that SPD placement significantly affects residual voltage levels and transient response stability. The optimal configuration is achieved by installing SPDs at the incoming side of the main panel, resulting in the lowest peak residual voltage and the most stable voltage response. The findings provide practical guidance for designing effective surge protection schemes in lightning-prone regions.