All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
If residents of the compound only are allowed to swim in the pool, you are not allowed to swim there even in the presence of your friend, unless there is a direct or customary permission for guests of the residents of the compound to swim there.
In fact, telling the watchman that you came to meet your friend, but in fact you came to swim, is a lie. You, undoubtedly, know the danger of telling lies. It was narrated on the authority of Ibn Mas`ood that the Prophet, sallallaahu ‘alayhi wa sallam, said: "Telling lies leads to wickedness, and wickedness leads to Hell, and a man may keep on telling lies until he is written, before Allaah, a liar." [Al-Bukhari and Muslim] Therefore, you have to repent to Allaah and not do that again.