The topotactic connection style of oxygen octahedron/tetrahedron in transition metal oxides (TMOs) is an important feature that modulates their corresponding physical properties. Using a simple chemical doping technique, we obtained Sr1-xNdxCoO3-δ with a crystal structure transition from face-shared octahedron to corner-shared octahedron/tetrahedron. The Rietveld analyses of the x-ray diffraction (XRD) patterns show that the crystal structure changes from rhombohedral to cubic and the connection style transforms from face-shared to corner-shared with the increase neodymium (Nd) content. During this process, the ferromagnetic behavior is greatly improved due to the larger amount of the corner-shared cubic SrCoO3-δ phase. The synchrotron radiation x-ray absorption spectroscopies of the Co L-edge and O K-edge show that Nd doping mainly affects the electronic structure of oxygen rather than the valence state of Co. Thereby, the Nd changes the connection style of oxygen octahedron/tetrahedron, which then alters the magnetic interactions.