This question is often used by atheists to put the theist in a bind. By answering yes, the theist is saying that God is not All-Powerful, and by saying no he is admitting that He is limited. Both these responses are false.
Imam Ali was once asked a similar question. He was asked, if it is possible for God to place something the size of the earth into something the size of an egg, without increasing the size of the egg, or decreasing the size of the earth. Imam responded by saying that God cannot be described by means of limits (Kitab Al-Tawhid). When Nabi Isa was asked this same question, he responded by saying that God cannot be described with ‘incapacity’ or ‘inadequacy’ (Mizan Al-Hikmah).This means that you cannot say that God cannot do this, because that would imply Him to be incapable, but this will also not occur because it goes against the laws of the universe that God has created.
Ayatullah Jawadi Amuli (2002) says:
A rationally impossible thing cannot have an external extension. Therefore, when Imam Ja‛far al-Sādiq, peace be with him, was asked about God’s power to place the world in an egg-shell, he responded, ‘Although God’s power is infinite, nevertheless, what you are asking is a nothing.’
‘Nothing,’ like non-existence or conjunction of contradictories, is a concept, which does not narrate an external extension. Therefore, because it is nothing, it is not subject to the infinite power of God. In other words; Allah SWT can do everything; but an impossibility is not a thing.
Amuli, 2002, p. 192.
There is a realm of logical possibility and impossibility. God can do everything within the realm of whatever is logically possible. What is impossible, cannot be done. Placing the earth in the egg without shrinking or enlarging the other is logically impossible.
A visual example: Power in Form The following example can be used to explain this idea further If one throws a flat piece of paper, it will not land very far: |

However, if one takes the same flat piece of paper, and crumples it up before throwing it, it will land much further: |



In this example, the paper thrown was the exact same each time, but the form in which it was thrown was different, resulting in a different outcome. In the first scenario it did not mean that the person throwing the paper did not have the physical strength to throw it far, rather it was the paper that could not reach that far. The ‘fault’ in this case, lies in the paper, not in the person throwing it. |
Similarly, God has the power to do as He wishes. However, the objects involved are too weak to accept the power of God. In the case of the stone paradox, the problem lies in the stone as the stone does not have the capacity to absorb the power it would require for it to have so much weight that God cannot lift it. Another outlook, or a rhetorical response, would be: whatever God creates, He has power over it because it is His creation, and therefore He can lift it.
Hence, it can be concluded that this question is fallacious. The fallacy in this question is called the either-or fallacy where the question presents possible choices, all of which are false. The correct choice is not presented amongst all the options, forcing the individual to always pick the wrong answer.
References
Amuli, A. J. (2002). A commentary on theistic arguments. Qum: Ansariyan Publications.
Cahn, S. M. (2013). Reason and religions: philosophy looks at the worlds religious beliefs. Boston, MA: Wadsworth / Cengage Learning.
Hadith Database Project. (n.d.). Retrieved August 20, 2020, from https://hadith.academyofislam.com/
Kamanpoori, S. A. H. (2017). Muharram Jaffari Islamic Youth Workshop. Vaughan.