What did the emperor ask Ma Lian to paint?

1. The emperor asked Ma Liang to paint a gold tree and a boat.

2. The emperor asked him to paint a gold tree and a boat.

3. He asked Ma Liang to paint a gold tree and a boat.

4. He asked him to paint a gold tree and a boat.

(Which one is the right answer for the question?)

All of those can be correct grammatically.

The first one gives the clearest information.