The correct answer is (d) had known.
Grammar Rule — 'As though / As if':
After 'as though' or 'as if', when the situation described is imaginary or contrary to fact:
— Present time reference → Past Simple (V2)
— Past time reference → Past Perfect (had + V3)
Analysis: 'He behaved...' — the verb 'behaved' is Past Simple, indicating a past action. The clause after 'as though' refers to something in the past (even more past than 'behaved'), so Past Perfect is required.
→ He behaved as though he had known everything. ✓
✗ 'knows' — Present Simple; tense mismatch.
✗ 'knew' — Past Simple; used when main verb is present ('He behaves as if he knew').
✗ 'has known' — Present Perfect; inappropriate here.
Source: A Practical English Grammar – Thomson & Martinet; Advanced English Grammar.