This is your homework so please show us some effort. You may find online many available documents on both forward chaining algorithm and n queens problem (for instance using Google
: "forward chaining algorithm"
], "n queens problem"
Read the documents, understand well both the problem and the algorithm and eventually start coding. Post here specific questions when you are stuck.