An electronic device having a multi-foldable housing structure is provided. The electronic device includes memory, comprising one or more storage media, storing instructions, and one or more processors communicatively coupled to the first display, the second display, the at least one sensor, and the memory, wherein the instructions, when executed by the one or more processors individually or collectively, cause the electronic device to, when an application is executed in a first state in which a first housing, a second housing, and a third housing are folded, display an execution screen of an application on a second display, identify, during execution of the application, based on data received from the at least one sensor, that the first housing and the second housing are switched from a folded state to an unfolded state, pause an execution of the application on the second display, based on the switch to the unfolded state, identify, based on data received from the at least one sensor, that the second housing and the third housing are switched from a folded state to an unfolded third state, and display the execution screen of the application on a first display, based on the switch to the third state.