I notice that after salat jumuah people do two versions of salat sunnah, 2 rakaat or 4 rakaat. What are the proper intentions of those two versions?
Both have been narrated in the authentic sunnah, as for doing two Rak'at the Prophet ﷺ used to pray them after leaving the Masjid at home:
كَانَ لاَ يُصَلِّي بَعْدَ الْجُمُعَةِ حَتَّى يَنْصَرِفَ فَيُصَلِّي رَكْعَتَيْنِ
He never prayed after Jumua prayer till he departed (from the Mosque), and then he would pray two rak`at at home.
In regards to four Rak'aat, The Prophet ﷺ said:
إِذَا صَلَّى أَحَدُكُمُ الْجُمُعَةَ فَلْيُصَلِّ بَعْدَهَا أَرْبَعًا
When any one of you observes the Jumu'a prayer he should observe four (rak'ahs) afterwards
This matter is in fact quite flexible, and scholars took different stances. The stance I will take to answer your question, is the stance that Ibn Taymiyah took, and that is if you pray at the Masjid your pray four, and if you pray at home then pray two. Another stance is making six Rak'aat, two for taking with what the Prophet ﷺ action, and four taking with what the Prophet ﷺ said, and it is viewed that doing six Rak'aat is liked as is narrated from Ali Ibn Abi Talib and a group of Salaf. Another Stance is the choice between the two.
And as I mentioned, I take the stance of Ibn Taymiyah to answer your question, and for more information see this (Arabic).