Learn the the גמרא דף נו. “בעצרת אומר לו הילך (two dots – seven lines from top of the Amud) until the two dots before the Mishna
Learn רא”ש פרק ד סימן ד who brings rishonim who rule that on the second night of Sukkos (in chutz laaretz) we switch the order and first day shehechiyanu and then make bracha leishev basukkah
https://hebrewbooks.org/pdfpager.aspx?req=14319&st=&pgnum=483
Learn שולחן ערוך אורח חיים ס’ תרמ”ג
https://hebrewbooks.org/pdfpager.aspx?req=60391&st=&pgnum=222
and ס’ תרס”א with the משנה ברורה
https://hebrewbooks.org/pdfpager.aspx?req=60391&st=&pgnum=268