Your question is how all pervading god resides in small space inside our heart Called as Daharakasha . Upanishads are giving us the answer of that. This subject is discussed in "Dahara Vidya" section of Chandogya Upanishad Which is Chapter 8.
Here Swami Sivananda is describing various vidyas discussed in Chandogya Upanishad .
This is one of the greatest of the Vidyas. The all-pervading and all-inclusive nature of the Self is stressed upon in this Vidya. In this meditation, the meditator feels the whole universe as his Self and excludes nothing from the One Self. This Vidya further explains the identity of the external and the internal, the objective and the subjective, the macrocosmic and the microcosmic, the universal and the individual. Brahman and Atman.
This abode, the small lotus that is here within this city of Brahman,
and the small space within that lotuswhat is there within this space,
that is to be searched out, that certainly is to be known. Verily, as
extensive as the external Akasa, is this eternal Akasa. Within it are
contained the heaven and the earth, both fire and wind, both Sun and
moon, lightning and stars, both what exists here and what does not
exist; everything here is contained within it.
Since Brahman is all pervading he is also indweller of all living beings as Jivatma , Chief Prana etc. he resides in this tiny space Called Dharakasaha which is equally infinite as outer space or Akasha so the point upanishads are making is that this tiny space inside our heart , which is lotus is also very large and it is also Brahman itself , just like the outer space is Brahman itself including all the other indriyas or organs of our body . See shloka no. 12
Besides that , this Barahman ,which is Atman itself is said to be equally subtlest and greatest at same time as described in Svetasvatara Upanishad 3.20. - See Page No. 75.
अणोरणीयान् महतो महीया- नात्मा गुहायां निहितोऽस्य जन्तोः ।
तमक्रतुः
पश्यति वीतशोको धातुः प्रसादान्महिमानमीशम् ॥ २०॥
Subtler than even subtlest and greater than the greatest , the Atman
is concealed in the heart of the creature. By the grace of the creator
, one becomes free from sorrows and desires and then realize him a the
great lord.
And the answer provided by Shree Adi Shankaracharya in explanation of
Chandogya Upanishad verse is as below.
ओं अथ यदिदमस्मिन्ब्रह्मपुरे दहरं पुण्डरीकं वेश्म
दहरोSस्मिन्नन्तराकाशस्तस्मिन्यदन्तस्तदन्वेष्टव्यं तदवाव
विजिज्ञासितव्यमिति || 1||
Then in this small lotus-like dwelling that is city of Brahman , there
is small space . That which exists in that space is to be known .That
indeed has to be enquired into for realization.
Shankara's commentary. - Dahara is smaller . Inn that small dwelling -since the dwelling is small , that which is included is
smaller than it. -antah, in that (dwelling) ; is Akasha , space called
Brahman . It will be said , 'That which is called as pace is
accomplisher of names and form (VIII .14.1) .Brahman is like space
because of unem-bodiedness , and because of the similarity of
subtleness and all -pervasiveness.
Here Brahman is said to the space or Akasha and since he is limitless , the space or Akasha which is said to be DharaKasha inside our heart is also limitless i.e. equally big as outer Akasha or Space . It is not to be taken as this Daharakasha is also small like our heart , but equally taken as large as Akasha.
Since Brahman is like infinite space and is said as space itself therefore the size of Dharakasha is also like him i.e. infinite. So this Dharakasha is not be taken as small but equally large as external Akasha. And thus the all pervading god (Brahman ) resides in it as he is equally small as well as large simultaneously.
In support of thr above verse Badrayana Vyasa in his
Brahma Sutras proves that , though this space of Daharakasha is small this doesn't mean that Brahman is also small. But this space is equally considered as large as external Akasha as Akasha is Brahman itself. Sarvam Khalvidam Brahma.
The related sutra is from Adhyay 1-Pada 3 -Sutra 14 with Shankaras commentary.
दहर उत्तरेभ्यः ॥ १४ ॥
dahara uttarebhyaḥ || 14 ||
Here the ‘small Âkâsa’ is Brahman and does not mean ether, though it
is the ordinary meaning of the word; nor does it mean the Jiva or
individual soul, though there is the qualification ‘small’, which may
show that it is a limited something. Why ? Because the characteristics
of Brahman occur later on in the text, “As large as this (external)
ether is, so large is that Âkâsa within the heart” (Chh. 8. 1. 3),
which clearly shows it is not actually small.