how did the civil war end? who surrendered

The South surrendered to the North. This kept the U.S. together as one nation.

http://en.wikipedia.org/wiki/List_of_civil_wars

I imagine your question was about the US Civil War, and Ms. Sue has given you good information. You should be careful in your terminology, though, because you can tell from the list linked above that there have been umpteen civil wars over the millennia.

The Civil War in the United States ended with the surrender of the Confederate forces. The final surrender took place on April 9, 1865, at Appomattox Court House in Virginia. General Robert E. Lee, the commander of the Confederate Army of Northern Virginia, surrendered to General Ulysses S. Grant, the commander of the Union Army.

To get this answer, one can refer to historical accounts, books, or articles about the Civil War. These sources provide detailed information about the events leading to the end of the war, the final battles, and the eventual surrender of the Confederate forces. Additionally, numerous primary sources, such as letters, diaries, and official documents, from that time period shed light on the end of the Civil War. By studying these sources, one can gain a comprehensive understanding of how the war concluded.