An electronic device is provided. The electronic device includes a display, a first
microphone, a second
microphone disposed to be spaced apart from the first
microphone, a
wireless communication circuit, memory storing one or more computer programs, and one or more processors communicatively coupled to the display, the first microphone, the second microphone, the
wireless communication circuit, and the memory, wherein the one or more computer programs include computer-
executable instructions that, when executed by the one or more processors individually or collectively, cause the electronic device to detect activation of an extended display configuration function, establish a
wireless connection with an external device using the wireless communication circuit, detect a sound output from the external device using the first microphone and the second microphone, recognize a position of the external device on based on a first sound
signal obtained by the first microphone and a
second sound signal obtained by the second microphone, produce a first screen to be displayed on the display and a
second screen to be displayed on a display of the external device, based on the recognized position of the external device, display the produced first screen on the display, and transmit the
second screen to the external device using the wireless communication circuit.