how do you do that on his and my playstation?
Well were you logged in under your PSN ID on his PS3 or your friends, if it was theirs then that's why, however if it was your own then after you beat the game you should have synced the trophy information, then once you got home done the same on your PS3.
Customer Service - 1-800-345-SONY (7669)
Account & billing Support -1-877-971-SONY (7669)
Available Mon to Fri 8am - 8pm PST
Live Chat Available Mon-Sat 6am-10pm PST & Sun 6am-8pm PST