Ibn ‘Umar narrated that the Messenger of Allah (ﷺ) said:
“Prayers at night and during the day are to be offered two by two.”

Asim bin Damrah said:
"We asked Ali about the prayer of the Messenger of Allah during the day. He said: 'You will not be able to do that.' We said: 'Whoever among is able (he will)?' So he said: 'When the sun appeared over there (east) like it appears here (west) at Asr, the Messenger of Allah would pray two Rak'ah, and when the sun appeared over there (east) like it appears here (west) at Zuhr, he would pray four Rak'ah. And he would pray four before Zuhr and two after it, and four before Asr separating between every two Rak'ah with At-Taslim upon the angels that are close (to Allah) and those who follow them among the believers, and the Muslims."

Could someone explain this hadiths to me?

Now I am very confused because many people told me that "at-taslim" must be said only at the end of the prayer

Aishah narrated that Allah's Messenger (S) said:
"Whoever is regular with twelve Rak'ah of Sunnah (prayer), Allah will build a house for him in Paradise: Four Rak'ah before Zuhr, two Rak'ah after it, two Rak'ah after Maghrib, two Rak'ah after Isha, and two Rak'ah before Fajr."

So what if I pray these 4 rak'ah before dhuhr?? Do I have to say "at-taslim" after second rak'ah or tasleem should be said only at the end of the prayer. If no, than could you explain these hadiths?

btw tasleem means saying "assalamu alaikum wa rahmatullah" to the right and left side

JazakAllahu khair